I have a .txt file consisting of very long paragraphs, with a single newline character separating each paragraph. I would like to convert this to a .csv format so that the file effectively has one column holding all the paragrahs, i.e., the first cell in each "row" contains the entire paragraph. However, I cannot use Excel to do this by simply opening the file in Excel and saving it as .csv, because some of my paragraphs are larger than the 1015 character limit that MS Excel has on a single field.


Assuming the text is properly escaped (i.e. embedded commas and linefeeds are double-quoted) you can just rename the file to .csv. There is nothing otherwise special about a CSV file format. It is essentially a text file.

There's actually a spec for CSV (you can read here). Note the rules for enclosing fields with double quotes: "Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes," and "If double-quotes are used to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote."

For example:

"You want to convert text to CSV," she noted.
This line doesn't need quotes (but they don't hurt).


"""You want to convert text to CSV,"" she noted."
"This line doesn't need quotes (but they don't hurt)."
| improve this answer | |
  • It's not escaped. I guess I could do a find+replace for all the relevant characters to add the double quotes, though. Thanks. – user216357 Apr 12 '13 at 1:08
  • 2
    To turn the current text into valid CSV, you can replace every double quote with a pair of double quotes, and then add a double quote to the beginning and end of each line. – Bradd Szonye Apr 12 '13 at 1:21
  • Yes. Notepad++ would be especially good for this. – Jamie Hanrahan Jun 9 '17 at 9:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.