My goal is to export a list of numbers into a file, with a comma between each value. Executing the following commands seems to produce a file with a new line between each entry.

v = {1.1, 2.2, 3.3};
Export["v.csv", v, "csv"];

When I open the file with notepad, what I see is

What I would like to see is comma separated values, like the following:
1.1, 2.2, 3.3

Recommendations? Thanks.


Because your expression v is a vector, it's being interpreted as one line per number.

The following gives your desired result.

Export["v.csv", {v}, "csv"]
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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