LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read from spreadsheet file with multiple delimiters

Is there a way to specify multiple delimitors in the read from spreadsheet file vi? I have a file that i need to read in that contains both space and comma delimitors and would like to read that data into an array using both delimitors (or not and). Below is the data I'm trying to read.

;attenuator data table
att00:   db       000h,015h,017h,035h,03Ch,03Eh,03Eh,05Ch,05Eh,05Eh
att10:   db       07Ch,07Eh,07Fh,09Dh,09Fh,09Fh,0BDh,015h,017h,035h
att20:   db       03Eh,03Eh,05Ch,05Ch,05Eh,07Ch,07Ch,07Eh,09Dh,09Dh
att30:   db       09Fh,0BDh,000h,000h,000h,002h,002h,002h,002h,003h
att40:   db       021h,021h,021h,021h,021h,023h,023h,023h,023h,023h
att50:   db       041h,041h,048h,048h,048h,04Ah,04Ah,04Ah,04Ah,068h
att60:   db       068h,068h,068h,068h,068h,06Ah,06Bh,06Bh,06Bh,089h
att70:   db       089h,089h,089h,08Bh,08Bh,08Bh,08Bh,0A9h,0A9h,0A9h
att80:   db       0A4h,0A6h,0A6h,0A6h,0A6h,0C4h,0C4h,0C4h,0C4h,0C6h
att90:   db       0C6h,0C6h,0C6h,0E4h,0E4h,0E5h,0E5h,0E7h,0E7h,0E7h

    END

I'm looking to just read in the data adjust the hex values and then save the data in the exact form which I read it in. If read from spreadsheet file can not recognize multiple delimiters that is all I need to know. I do not want to spend time reading it in using a single delimitor and doing a bunch of string manipulation. I'm also working with LabView 8.5 if that makes a difference.
0 Kudos
Message 1 of 2
(3,134 Views)
You should use "scan string for tokens", and wire an array of delimiters.
 
One nice behavior is the fact that consecutive delimiters are contracted into one (by default), so e.g. if your delimiters is an array containing a space and a comma, a sequence of three spaces and a comma would still count as one delimiter.
 
For some ideas, have a look at my old example here:
 
 
0 Kudos
Message 2 of 2
(3,130 Views)