05-10-2019 08:01 AM
I want to save 2d data in .csv file. How can I do it ?
05-10-2019 08:09 AM
05-10-2019 08:10 AM
First, a csv (comma separated variable) formatted file is not an Excel file, although Excel can be used to display and edit one.
There is, on the string functions palette, a function called "Array to Spreadsheet" that will format a data array into a string table. The default "delimiter" (commas in your instance) is the "tab" character, but this is selectable. Then you write the string to a file using the standard file functions. There is a reverse function that converts "spreadsheet" strings back to arrays of data on the same string palette.If you download/install the OpenG tools there are some additional, powerful string functions that can be used as well.
05-10-2019 04:30 PM
One reason you (and many other) confuse "Delimited Spreadsheets" (and other .csv files) with "Excel" is if Excel is installed on your computer, Microsoft "high-jacks" the .csv extension and assigns it an Icon that looks like the icon for Excel. Excel can open a .csv file, but so can Notepad (try it -- it's especially easy to read if the "horizontal separator" is a <tab> instead of a comma).
Bob Schor
05-11-2019 05:38 PM
@Bob_Schor wrote:
it's especially easy to read if the "horizontal separator" is a <tab> instead of a comma
But then it isn't really a CSV. I have ran into enough international issues that I no longer use CSV formats. Just as Bob was alluding to, I use tab delimited text files (*.txt). You can still open them in Excel if you want (right-click, Open With->Excel), but they read just as well in Notepad or UltraEdit.