• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

how to write comma in CSV file

 
Ranch Hand
Posts: 247
MyEclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i changed the constructor

 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll bet dollars to donuts that you still have no idea what in CSVWriter's terminology "escape characters" and "quote characters" are; otherwise you wouldn't be passing seemingly random values for those to the constructor.

Tell us this: why are you not using the constructor that takes nothing but the Writer as parameter? That's the one you should be using.
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Lester Burnham wrote:I give up.



It's worse than trying to give up smoking.
One more post can't do any harm. I'll stop again tomorrow. Honest.
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

One more post can't do any harm.


One likes to think so. It may even do some good, in due course. Hope springs eternal.
 
Raza Mohd
Ranch Hand
Posts: 247
MyEclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
but i told you that it gives me Quotes when i open it in notepad if i use only writer as parameter

Thats the problem i have.

 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you did say that. And I replied "Of course there are quotes - that's how CSV works". If the individual cell entries contain commas, then those entries must be quoted. Why do you think that's a problem?

If you're still not sure how CSV works, I suggest to create an example file in Excel -having cells that contain both double quotes and commas- and to save that as a CSV. If you then open it in Notepad and study how the cell contents have (and have not) changed, you will get an understanding of CSV (which apparently so far you have not).
 
Raza Mohd
Ranch Hand
Posts: 247
MyEclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks dear..
actually in the need of fulfillment of client request .
I forgot it.

And also there is no tutorial about constructor.
I really did not understand how the NO_QUOTE_CHAR works.
can you tell me where can i find tutorials on that.

Thanks
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does that mean that the problem is now solved? Or are you saying that the client requires that there be no double quotes around entries, despite them containing commas? If the latter, then that's impossible, and you need to educate the client on how CSV works.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic