LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find the maximum value of TXT file in particular row?

Hello, everyone
My TXT file is 8x2000 values
I want to find out the maximum in the first row
The second row..until the eight row
In each row and find the maximum value
First,I use "read from spreadsheet"  this vi to read the txt file
However, this vi only have  "all rows" and "the first row"
 
Please enlighten me greatly .3 Q-~~

0 Kudos
Message 1 of 6
(2,871 Views)

Are trying to get the maximum out of the rows or out of the colums?  There are 8 colums in your data file, so I'm thinking you really meant colums.

 

Once you have the 2D array, use the Array Index to get the colum you want and then the Array Max & Min to get the maximum value and/or index.

If you are trying to do this on all of the colums, transpose the array and then use a for loop with autoindexing.


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
0 Kudos
Message 2 of 6
(2,862 Views)

You've started correctly with the Read From Spreadsheet File. You can then take the 2D output and wire it to a for loop. It will autoindex row by row.

 

p.s. It looks like your text file is really 2000 rows and 8 columns. You can configure the read to transpose if you really want 8 rows with 2000 columns.

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

yes , i mean trying to get the maximum out of the colums. sorry~

 

so i need  use "read from spreadsheet.vi"  at first to read my txt file ?

and then use "Array Index.vi" at second to find  the colum i want

Third, use Array Max & Min.vi      

 

thank you~

0 Kudos
Message 4 of 6
(2,850 Views)

Not at all sure why you want to use the Index Array function.

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

To add to Dennis's comment, if you are looking for the max in all of the colums, use a for loop with the autoindexing.  You will need to transpose the 2D array, but that is still better.


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
0 Kudos
Message 6 of 6
(2,831 Views)