mperdeck / LINQtoCSV

Popular, easy to use library to read and write CSV files.
197 stars 112 forks source link

Exporting CSV Pin #25

Closed danemarshall closed 10 years ago

danemarshall commented 10 years ago

Hi,

The below code works fine and is exporting my CSV results as expected. However when I go to re-save the file after opening it with Excel, it auto saves it as "Unicode Text" without a filename and no CSV (Comma delimited) by default. Any ideas?

var outputFileDescription = new CsvFileDescription { SeparatorChar = ',', FirstLineHasColumnNames = true, FileCultureName = "en-GB", QuoteAllFields = true };

        var cc = new CsvContext();

        cc.Write(o, "File.csv", outputFileDescription);
mperdeck commented 10 years ago

I'm sorry Dane, but I don't know. I don't have access to Excel. Linq2csv essentially creates simple text files with CSV records. Seeing that Excel opens the file ok, I'm not sure there is an issue with Linq2csv.

Because of all this, I'm not really inclined to spend time investigating this. However, if you find a specific problem in the CSV generated by Lin2csv, I would be happy to hear about it and fix the issue.