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."
"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)."
protected by Community♦ Jun 9 '17 at 8:40
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?