Question

I want to create .csv files with the Report Generation Toolkit in Labview.

They must actually be .csv files which can be opened with Notepad or something similar.

Creating a .csv is not that hard, it's just a matter of adding the extension to the file name that's going to be created.

If I create a .csv file this way it opens nicely in excel just the way it should, but if I open it in Notepad it shows all kind of characters and it doesn't even come close to the data I wrote to the file.

I create the files with the Labview code below:

Link to image (can't post image yet because I've got to few points)

I know .csv files can be created with the Write to Spreadsheet VI but I would like to use the Report Generation Toolkit because it's pretty easy to add columns and rows to the file and that is something I really need.

Was it helpful?

Solution

you can use the Robust CSV package on the lavag.org forum to read and write 2D arrays to CSV files.

http://lavag.org/files/file/239-robust-csv/

OTHER TIPS

Calling a file "csv" does not make it a CSV file. I never used the toolkit to generate an Excel file, but I'm assuming it creates an XLS or XLSX file, regardless of what extension you give it, which is why you're seeing gibberish (probably XLS, since it's been around for a while and I believe XLSX is XML, not binary).

I'm not sure what your problem is with the write spreadsheet VI. It has an append input, so I assume you can use that to at least add rows directly to a file, although I can't say I ever tried it. I would prefer handling all the data in memory explicitly, where you can easily use the array functions to add rows or columns to the array and then overwrite the entire file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top