LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.CSV to array parser help

Hi all. I have been tryint to find a .csv parser and after searching the forums a bit, i found something that was close to what i needed.  I have edited a bit and it works pretty well, but still not exactly what i need.  So basically right now a string like

hi, how, are, you  parses just fine into 4 columns.

 

Similarly "This, That", Hi, "you", Were    also gets separated correctly into 4 columns.

 

I am having trouble with a specific case such as

""hi","you"",this, that, why     The double quotes should keep "hi","you" in one column, but i can not figure out how to test for this, or any variation of this such as triple quotes with a comma in bettween any of the quote etc... 

 

 

Does that make any sense? i feel like i am rambling 🙂

I have attached my .vi.  Please let me know if you have any ideas.

thanks!

0 Kudos
Message 1 of 5
(3,989 Views)

Consider the Spreadsheet String to Array function:

 

SpreadsheetStringToArray.png

0 Kudos
Message 2 of 5
(3,981 Views)

Unless something has changed in 2010, i dont think that will work. Wont it just use every comma as a delimitter?

In a .csv file, any commas enclosed in quotes needs to be ignored. 

 

0 Kudos
Message 3 of 5
(3,979 Views)

If the Spreadsheet String to Array won't suffice for your task, there are two RegExperts who I would not be surprised to see posting here pretty soon, like two chickens on one junebug.

Message 4 of 5
(3,977 Views)

Okay, i finally think i have a working solution. (i have attached)  Its not the prettiest solution, but seems to be working.  Anyone see any obvious ways to clean it up or similar?

 

thanks!

 

The last VI attached will read an entire .csv.   If some of you dont mind can you try it out and let me know if there are any bugs im missing?

Thanks!

Download All
Message 5 of 5
(3,948 Views)