LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

csv format data extraction

Solved!
Go to solution

Ladies and Gentlemen -

    I am attempting to extract an array of real values from a csv formatted string. The number of values is arbitrary. I am apparently goofing up the formatting string in the "Scan from String" function. If anyone could offer formatting advice I would be very grateful. The format of the string going INTO the "Scan from String" function is as follows:

 

-7.23570E+01,-8.99010E+01,-7.42040E+01,-9.09890E+01,-7.35500E+01,-1.09656E+02,-7.38520E+01, (and many values follow)

 

A Scan string I have attempted is [-+]%.5e[,], but all return "The input string does not contain data in the expected format."

 

Thank you again!!

 

Tony

 

 

 

 

 

  

0 Kudos
Message 1 of 6
(2,932 Views)
Solution
Accepted by topic author TonyRadice

Just use the Spreadsheet String To Array with the format set to "%f" and the delimiter set to a comma.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 6
(2,926 Views)
Solution
Accepted by topic author TonyRadice

crossrulz suggestion is a good one.

If you're set on using Scan from String, the format specifier you want is  "%.5e," and you want to read in a loop using a shift register to store the remaining string.

The [+-] is automatically handled in the specifier and you don't need to bracket the ending comma.

0 Kudos
Message 3 of 6
(2,921 Views)

Folks -

     Thank you for the solution!! She's a workin'...

 

Have a great day!!

 

Tony

0 Kudos
Message 4 of 6
(2,859 Views)
Solution
Accepted by topic author TonyRadice

Tony,

 

     Whichever post (or posts) you considered gave you "the solution", please mark it as The Solution.  We're not paid for being helpful, but it is the Kudos and Solution acknowledgements that keeps us coming back to help others.

 

Bob Schor

0 Kudos
Message 5 of 6
(2,844 Views)

Bob -

    Thanks for the pointer. Done.

 

T.

0 Kudos
Message 6 of 6
(2,832 Views)