comma « CSV file « Java I/O Q&A





1. Creating CSV file where values contain comma    coderanch.com

Hi all, Can someone tell me how to generate a CSV file and handle the case when values contain comma in them. If i use MyString.replaceAll(",","\,")->this is not allowed, i will have to use MyString.replaceAll(",","\\,"),but finally these two backslash cancel each other and what is left is comma. I want to create CSV file while exporting data from database and while ...

3. Comma Separated Values (CSV) Splitter. The guts of a CsvReader.    forums.oracle.com

/** * Comma Separated Values (CSV) Splitter. The guts of a CsvReader. *

* Splits a line of text into fields on a field-separator character. When the * field-separator character is quoted it is treated as data (not a separator). * The quote-character may be escaped using two consecutive quote-character. *

* Important Note:

    * This implementation DOES NOT ...

4. commas in my CSV file data    forums.oracle.com

You could try using a double-quote (") around the text instead of a single-quote. However, the tool you use to display the data (Excel, etc.) will determine how the data is interpreted. Of course, using double-quotes just moves the issue to another character. You could also replace offending characters with other characters but this solution seems a little cheesy. I do ...

5. comma in csv file    forums.oracle.com

6. CSV file - but one field value itself containing comma - '\' is not woring    forums.oracle.com

when at first opeing with excel, it is coming like abc and pqr in first cell and xyz and 00000 in the next cell. If the select the first cell and do Data -> Text to Columns -> selecting 'Delimited' radio button -> Next -> selecting Others checkbox -> putting my own delimiter (like pipe (|)) -> Finish. Then it is ...

7. Problem with CSV and Commas    forums.oracle.com

Now my problem is that one of the values is a Country and City that is separated by a comma.. Example San Francisco, California But it is supposed to be treated as a single text so this text should occupy only one cell in excel.. What happens is that it separates them and places it in different cells.. So my question ...

8. CSV file - how to eliminate the comma?    forums.oracle.com

As implicitly suggested above the example you posted is an invalid csv file. Regardless of what you do you will not be able to parse the example you posted using the normal csv rules. So either you posted the wrong example or you are going to need to write a parser that does something slightly different than what a regular csv ...