I'm trying to export the following string
"sep = ,"
to a CSV-file, as to be able to define the separation symbol.
However, when using the following command:
Export["test.csv", Join[{"sep = ,"}, RandomInteger[{-5, 5}, {5, 3}]], "CSV"]
I get the quotes around the string in the first line:
"sep = ,"
-4,5,0
5,-4,-1
0,5,2
-1,2,4
-1,-4,-1
This obviously isn't recognized by Excel and it doesn't open correctly. I've tried changing the string to something like
Style["sep=,", ShowStringCharacters -> False]
and then export again, but then I just get this whole command into the CSV-file.
Is there a method to export this string without the quotes attached to them into a CSV-file?
stream=OpenWrite[file];WriteString[stream, "string..."];Close@stream
or ifOpenWrite
is called with the optionFormatType -> OutputForm
, but that might cause unwanted formatting on other characters. $\endgroup$