ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

csv with double quotes

Solved!
Go to solution

Hello,

 

I've had harsh time trying to figure out how to read a csv file with double quotes, I need to read a csv file in order to fill a spreadsheet.

I attach a csv file example to show the sort of file I'm working on.

 

Thank you

Raymundo Cassani
0 Kudos
Message 1 of 6
(6,767 Views)

Search and Replace to ditch the quotes then Spreadsheet String to Array.

 

DitchQuotes.png

Message 2 of 6
(6,748 Views)

I already try that solution, but it doesn't work, because it just delete the double quoutes. If you open the csv test file with a spreadsheet application (for example Excel), you'll find that there are only two columns.

 

test.jpg

Raymundo Cassani
0 Kudos
Message 3 of 6
(6,719 Views)
Solution
Accepted by topic author rCassani

Upon closer inspection, you are right, it was a trick question.  You need to look for commas that follow an even number of quotation marks for the separators.  Since my previous snippet was not converted, I assume you have an earlier LV version so I have attached an example in 8.6.  You can get rid of the quotes if you like (exercise for the reader).

 

CSV ReadWithQuotes.png 

 

Message 4 of 6
(6,708 Views)

By the time I read your reply I had a solution, but my vi is very involved; yours is simplier and easier to understand. 

Thank you.

Raymundo Cassani
0 Kudos
Message 5 of 6
(6,684 Views)

Could you possible post either the block diagram or the VI in version 7.1?

Thank you.


When I started programming in 1979 there weren't CSV files, however my recollection is that CSV files existed in the late 80's, which would have been around LabVIEW version 2.0, and I don't recall when Spreadsheet String to Array was introduced.  It would be nice after 20 years of development and 10+ versions for CSV to be properly parsed...



Regards,



Leif Kirschenbaum

LabVIEW user since 2.0
0 Kudos
Message 6 of 6
(6,493 Views)