LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to read a CSV string

Hello,
 
   What is the best way to read a CSV (Comma Seperated Value) string with the following constraints
 
  1. Do not know how long the string is, but for this discussion we could assume no longer than 500 chars
  2. Do not know how the max number of commas that will be in the string, but there will be at least 1 comma (for 2 values in the string) 

If I was using PERL (the split function) or if the formula nodes could handle strings, then this would be solved. I have tried to use the "scan from string" vi, and keep getting Error 85. This vi also assue that the user knows how many commas are in the CSV string before you try to extract the values from the string. Any ideas on how I can do this?

Regards,

Kaspar

 

 

Regards,


Kaspar
0 Kudos
Message 1 of 7
(3,254 Views)
How about just using Spreadsheet String to Array? That's what that function is for.
Message 2 of 7
(3,251 Views)
or maybe scan string for tokens. Do you want an array of strings as the output??

Message Edited by unclebump on 08-12-2008 11:07 AM
Message 3 of 7
(3,248 Views)
Hello,
 
   The vi you posted is in Labview 8.2, could you repost it as a 8.2 vi? I am looking to get the values back as strings.
 
Regards,
 
Kaspar
Regards,


Kaspar
0 Kudos
Message 4 of 7
(3,234 Views)



To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.


Message Edited by smercurio_fc on 08-12-2008 11:21 AM
Message 5 of 7
(3,232 Views)
Here is the 8.2 version.
Message 6 of 7
(3,198 Views)

Hello,

 

   Thanks for the 8.2 version!

 

Regards,

 

Kaspar

Regards,


Kaspar
0 Kudos
Message 7 of 7
(3,185 Views)