Newlines in Excel export
Hello,
Consider the following data structure:
Dump:
Export to Excel:
Since the data table contains one row I'd expect two rows in Excel (one header row and one data row), as follows:
Expected output:
LINQPad 5.40.00
Excel for Office 365 MSO (16.0.11901.20070) 32 bit
Consider the following data structure:
new[,] { { "aa", "bb\r\ncc" } }
Dump:
Export to Excel:
Since the data table contains one row I'd expect two rows in Excel (one header row and one data row), as follows:
Expected output:
LINQPad 5.40.00
Excel for Office 365 MSO (16.0.11901.20070) 32 bit
Comments
If you're exporting a simple table, the most reliable approach is to generate a CSV file with Util.ToCSV, or use the Data Grid mode and export from there. However, you'll first need to write a helper method to convert the 2d array into a standard IEnumerable.