LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert a text file to an array, then extract a range of data points from it.

Solved!
Go to solution

I want to do the following steps:

 

1. Read from a text file and convert it to an array.

         My text files are with 2 colums, like this:

          1  1053

          1.3  1044

          1.5  2033 

          1.7  2444

          1.9  4335

 

2. Extract a range of data points from that array.

       I wanna give it an order to extract the data points that I want and output as an new array.

      The range starts when colum 1 value > 1.2, and end when colum 1 value < 1.8. (1.3 to 1.7)

      And extract the range of data from these two colums, so my expect result array is:

          1.3  1044

          1.5  2033 

          1.7  2444

 

Can anyone help me?

I'm a new user of labview haha, Thanks a lot!!!!

0 Kudos
Message 1 of 5
(2,737 Views)

"Read from spreadsheet file" (or "read delimited spreadsheet" for newer LabVIEW) will get you the data as a 2D array.

(Your post does not show the delimiter between entries. Is it a space or a tab character?)

 

To get a subset, use "array subset".


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 2 of 5
(2,727 Views)

altenbach 已寫:

"Read from spreadsheet file" (or "read delimited spreadsheet" for newer LabVIEW) will get you the data as a 2D array.

(Your post does not show the delimiter between entries. Is it a space or a tab character?)

 

To get a subset, use "array subset".



Thanks for ur quick response!

Do you mean the separation of colum 1 and 2 in the text file?

The separation between colume 1 and 2 in the text file is like this.

 

Thanks!

0 Kudos
Message 3 of 5
(2,725 Views)

@Ying88827 wrote:

The separation between colume 1 and 2 in the text file is like this.

 


OK, your column seperator is the tab character. This is the default, so you don't need to wire it.


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 4 of 5
(2,675 Views)
Solution
Accepted by Ying88827

Again you still have not mentioned your LabVIEW version, but here's one simple solution.

 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Message 5 of 5
(2,639 Views)