I am trying to import data from a CSV file into Mathematica that contains line feeds in certain elements that I wish to be properly rendered in Mathematica. I suppose this has something to do with the type of form (InputForm, StandardForm, etc.) that Mathematica uses on and after import. I know I am missing something fundamental but have not found it yet.
I do not want the solution to this problem to contain any Mathematica code in the CSV file.
Lets take graph labels as an example.
I would like one vertex label to have two on the first line and deux on the second line. I have tried entering the data in various ways with no success. Here is what I have tried.
- two[LineFeed]deux
Result: is shown above. There IS a linefeed but the control code name is also rendered.
- two\ndeux
Result: No line feed at all.
- two.0Adeux (i.e. using hexadecimal code)
Result: Same as [NewLine], get the line feed but the hex code is printed too.
Thanks in advance for your help.
Jeff Lapides
ImportString[ExportString[{{1, "long\nthing"}, {2, "other"}}, "CSV", "TextDelimiters" -> "\""],"CSV", "TextDelimiters" -> "\""]
returns{{"1,\"long"}, {"thing\""}, {2, "other"}}
$\endgroup$