annuler
Affichage des résultats de 
Rechercher plutôt 
Vouliez-vous dire : 

csv with double quotes

Résolu !
Accéder à la 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 Compliments
Message 1 sur 6
6 606 Visites

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

 

DitchQuotes.png

Message 2 sur 6
6 587 Visites

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 Compliments
Message 3 sur 6
6 558 Visites
Solution
Accepté par 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 sur 6
6 547 Visites

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 Compliments
Message 5 sur 6
6 523 Visites

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 Compliments
Message 6 sur 6
6 332 Visites