09-15-2010 11:06 AM
I would like to be able to read comma separated files (.csv) into LabView. The code implementation must follow all the rules for .csv files.
Please see basic rules here if unsure what I mean.. http://en.wikipedia.org/wiki/Comma-separated_values
Does anyone have any working, good code to share?
Thanks,
Patrik
Solved! Go to Solution.
09-15-2010 11:09 AM
When you tried the Read From Spreadsheet File with a comma as the specified delimiter, what problems did you have?
09-15-2010 11:39 AM - edited 09-15-2010 11:46 AM
Then..
Commas inside double quotes are not treated correctly when doing so. Commas inside double quotes should be kept and not be treated as separators. Another problem is that line brakes inside double quotes should be treated as a line brake within the same column and not a line break for the whole table. Furthermore, most double quotes should be removed but some should be kept. Please see the link that I provided for the details..
It surprises me that this is not a native LabView VI already.
Thanks,
mrsound
09-15-2010 11:50 AM
Something eerily similar....
http://forums.ni.com/t5/LabVIEW/csv-with-double-quotes/m-p/1098279#M485663
09-15-2010 11:51 AM - edited 09-15-2010 11:54 AM
Okay, now I understand what you are looking for.
No, the function depends on the Spreadsheet String to Array which does not support a " as an escape character. This function was written long before the mentioned CSV "standard". I've never seen any request for this functionality but you can submit it to the Idea Exchange.
Darin - thanks for the link. My search came up blank.
09-15-2010 11:51 AM
It sounds like you are going to have to do some custome work. You are going to have to open it as a string an then post process it to achieve what you are looking to do.
09-15-2010 11:57 AM - edited 09-15-2010 11:58 AM
@Darin.K wrote:
Something eerily similar....
http://forums.ni.com/t5/LabVIEW/csv-with-double-quotes/m-p/1098279#M485663
Yes, but the double quotes are still there and it doesn't work for line brakes within the same cell.
09-15-2010 12:10 PM
@aeastet wrote:
It sounds like you are going to have to do some custome work. You are going to have to open it as a string an then post process it to achieve what you are looking to do.
I was hopeing it was already implemented so that I could save myself some work..
05-20-2011 08:33 AM - edited 05-20-2011 08:34 AM
I recently needed to parse a CSV that contained quotes and line breaks within a field. Here is my solution (LV 8.0)...
06-01-2011 11:36 AM
Thank you! 🙂