| Author |
Write comma with CSVWriter + help needed
|
Raza Mohd
Ranch Hand
Joined: Jan 20, 2010
Posts: 247
|
|
can anybody give me solution that i want my CSV file with no Quote character.
and i using Final field NO_QUOTE_CHAR
and i want to write a field which is having Comma in it.
for example ::
cvv number ('Q','C')
card number
Id
please help me..
i stuck for a long time.
|
Good luck!!
A small leak can sink a Gigantic ship.>
|
 |
Matthew Brown
Bartender
Joined: Apr 06, 2010
Posts: 3793
|
|
|
What output are you getting from that code?
|
 |
Raza Mohd
Ranch Hand
Joined: Jan 20, 2010
Posts: 247
|
|
thanks for reply:
cvv number ('Q','C')
underlined field is splitted in two shells when i open it in excel because of comma .
i want it to be in a single field.
|
 |
Raza Mohd
Ranch Hand
Joined: Jan 20, 2010
Posts: 247
|
|
|
output split the field into two.
|
 |
Matthew Brown
Bartender
Joined: Apr 06, 2010
Posts: 3793
|
|
|
I'm probably missing something...but isn't that what the quote characters are supposed to solve? If you put the entire field in double-quotes then Excel will treat it as one field. It looks to me like you've deliberately turned off the feature that will help you.
|
 |
Raza Mohd
Ranch Hand
Joined: Jan 20, 2010
Posts: 247
|
|
|
so what should i do?
|
 |
Matthew Brown
Bartender
Joined: Apr 06, 2010
Posts: 3793
|
|
Well, can you not try:
or
?
|
 |
Raza Mohd
Ranch Hand
Joined: Jan 20, 2010
Posts: 247
|
|
actually if i use these..
i get Quotes when i open it in wordpad and that is not desired.
can somebody solve that issue for me.
Thanks
Raza!
|
 |
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4166
|
|
|
You appear to have two conflicting requirements. Like it or not, you'll have to drop one or the other.
|
luck, db
There are no new questions, but there may be new answers.
|
 |
Raza Mohd
Ranch Hand
Joined: Jan 20, 2010
Posts: 247
|
|
is there any conndition that using NO_QUOTE_CHAR i can make one field to write irrespective of comma.
or i can escape comma for only one field?
Thanks Raza!
|
 |
Matthew Brown
Bartender
Joined: Apr 06, 2010
Posts: 3793
|
|
|
Quotes are the mechanism that CSV files use to cope with commas - I don't think Excel is going to understand anything else. If you really can't have them, I think your only other option would be to remove the comma first - replace it with a different character.
|
 |
Raza Mohd
Ranch Hand
Joined: Jan 20, 2010
Posts: 247
|
|
i can not replace it.
as the files to be generated with the same format only.
with the DEFAULT_QUOTE_CHAR excel is fine but when i open in notepad it gives entries surrounded with Quotes.That should not be there because the client do not want it.
|
 |
Matthew Brown
Bartender
Joined: Apr 06, 2010
Posts: 3793
|
|
|
I think you're going to have to explain to the client that Excel and Notepad work in fundamentally different ways, and the file cannot be generated so that it behaves the way they want in both of them. They're going to have to choose.
|
 |
 |
|
|
subject: Write comma with CSVWriter + help needed
|
|
|