LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

parse numbers from .lst file

Hi,

I have a .lst file with a text and numbers in different lines.

Now I'm trying to read the floating point number from a specific line.

I'm using the "read from spreadsheet" function and have a "index array" function connected to the all rows outlet.

But it doesn't read anything. 

0 Kudos
Message 1 of 6
(3,431 Views)

Hi,

 

Try using read from binary file. Try finding the number of lines using match pattern (\n\r,\n,\r..) then use it to create an arrary of individual lines using "Pick line" primitive from string pallete in a for loop. This will finally give u an array of individual lines. Hope this is what you are looking for.

-Mallya

" Appreciate and motivate those who help"
0 Kudos
Message 2 of 6
(3,417 Views)
Posting what you have is worth a thousand words.  I'm not sure I understand what you want.
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 3 of 6
(3,401 Views)

What delimiter are you using to seperate the numbers from the non-numeric characters?

Can you post the file?

0 Kudos
Message 4 of 6
(3,395 Views)

The code snippet below should work for most cases, unless your text follows the numbers or if you have text after your number.  You can easily modify the code to cure that..

 

 

Message Edited by Ray.R on 12-09-2009 08:13 AM
0 Kudos
Message 5 of 6
(3,389 Views)

Here's the content of the test file I was using:

 

i want to 123.12
read 333.232
this  2121.86
line 555.1212
here 31.67
not  98.89
this one 999.333

 

 

When I ran it, I entered 'here' as the text to search (control on front panel).

0 Kudos
Message 6 of 6
(3,386 Views)