LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i read a text file and then display the content as a string

Solved!
Go to solution
I also would like to strip the string from a certain substring and convert the remaining string into an array of floating point numbers. I was thinking of using the read from spreadsheet vi but I'm not exactly sure if that is going to work. Any help would be greatly appreciated.
0 Kudos
Message 1 of 9
(3,947 Views)
To add to my previous comment, I think I am supposed to use a read from file and then use an indicator to show the file as a string. Then I was thinking about using the matching pattern but I wasn't sure exactly how to do that
0 Kudos
Message 2 of 9
(3,938 Views)

Alana

 

Can you post the sample string that you wish to convert in to arrays? There are lots of metods available to do it..If they are commas seperated or tab delimeted (or anything similar) then use the "Spreadsheet String To Array" function found in the strings pallete

 

Guru

Regards
Guru (CLA)
0 Kudos
Message 3 of 9
(3,930 Views)
Post the vi what you have did so far. Also post the text file. Make sure to zip all of them if it is huge in size. Give some sample values of how the output would be like.
0 Kudos
Message 4 of 9
(3,929 Views)

Hello Alana,

 

Can you please specify the format of the string that you have to strip?

I mean will it have the same pattern of strings preceeding the numbers?

Eg :- if your string is like "KRU 23", "NAL 24", "KRU 25", then you can use scan from string function directly to get the string as well as numeric output.

 

0 Kudos
Message 5 of 9
(3,925 Views)
Here is what I have so far. What I am trying to do is to display the text file as a string and then strip the "curve" from the text file. I think I did this successfully. Now I want to convert the remaining string into an array of floating point numbers, and display the numbers into an array and on a waveform graph.
Download All
0 Kudos
Message 6 of 9
(3,915 Views)

here you go alana

 

 

 

 

 

Regards
Guru (CLA)
0 Kudos
Message 7 of 9
(3,908 Views)
Thank you, but unfortunately I cannot open the vi because I have an older version of labview. Would you mind posting a photo of the block diagram?
0 Kudos
Message 8 of 9
(3,885 Views)
Solution
Accepted by topic author Laudie3a
Here it is as 8.6. All you had to do was wire the 'after string' to the Spreadsheet String to Array.
0 Kudos
Message 9 of 9
(3,878 Views)