I don't have Excel 2007, but I have Excel 2010, and the example given: ID,Name,Descriptionĭoesn't work. It seems to be locale dependent (which seems idiotic, in my humble opinion). It does a much better job of stuff like this than any version of Excel I've tried, and it can save to XLS or XLSX as required if you need to transfer to Excel afterwards.īut if you're stuck with Excel and need a better fix, there seems to be a way. If you are doing this manually, download LibreOffice and use LibreOffice Calc to import your CSV. It's just the line breaks that are causing problems. Note that the comma in "Smith, Joe" is being handled properly. When I import this into Excel 2007, I end up with a header row, and two records. Here's a quick file I wrote by hand to duplicate the problem. Has anyone else encountered this behavior, and if so, how did you fix it? I've also tried replacing CR/LF (\r\n) with just CR (\r), and again with just LF (\n), but no luck. However, when I import the data into Excel 2007, set the appropriate delimiter, and set the text qualifier to double quote, the line breaks are still creating new records at the line breaks, where I would expect to see the entire text field in a single cell. In order to counteract this, I have wrapped the field in double quotes ("). One of the fields is a free-text field, which may contain line breaks, commas, quotations, etc. I'm working on a feature to export search results to a CSV file to be opened in Excel.
0 Comments
Leave a Reply. |