ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extract unique data from column

Hello,

 

How do I go about extracting unique non-zero data from a column based on data in the first column.

 

In the attached CSV file, the data looks like:

Cold Start Test @ 22.4 °C  
       
cold start #1    
index Start type Test1 Test2
1 cold start 46.67 491.394
2 cold start 46.67 491.394
3 cold start 0 0
4 cold start 0 0
5 cold start 0 0
6 cold start 0 0

....

26 cold start 0 0
27 cold start 0 0
28 cold start 70.17 24.948
29 cold start 70.08 24.948
30 cold start 70.08 24.948
       
cold start #2    
index Start type Test1 Test2
1 cold start 72.42 24.948
2 cold start 0 0
3 cold start 0 0
4 cold start 0 0
5 cold start 0 0
6 cold start 0 0
7 cold start 0 0

... (see attached csv file for more details)

 

How can I go about getting the non zero numbers from column 3 starting after index 4?  

 

Thanks!

 

 

 

Download All
0 Kudos
Message 1 of 3
(1,371 Views)

Hi hiNI,

 


@hiNI wrote:

How do I go about extracting unique non-zero data from a column based on data in the first column.

 

How can I go about getting the non zero numbers from column 3 starting after index 4?


  • Read the CSV file as array of strings using ReadDelimitedSpreadsheetFile.
  • Find the row with "index=4" and continue to use the ArraySubset after that row.
  • Get column 3 as 1D array.
  • Use an autoindexing FOR loop with a conditional output tunnel to filter any string elements different to "empty", "0", or "Test*".

Now you get all non-zero values from column 3 - you may filter for "unique" elements when needed.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(1,329 Views)

@GerdW wrote:

Hi hiNI,

 


@hiNI wrote:

How do I go about extracting unique non-zero data from a column based on data in the first column.

 

How can I go about getting the non zero numbers from column 3 starting after index 4?


  • Read the CSV file as array of strings using ReadDelimitedSpreadsheetFile.
  • Find the row with "index=4" and continue to use the ArraySubset after that row.
  • Get column 3 as 1D array.
  • Use an autoindexing FOR loop with a conditional output tunnel to filter any string elements different to "empty", "0", or "Test*".

Now you get all non-zero values from column 3 - you may filter for "unique" elements when needed.


a set will filter automatically all unique values, when you add them into the set

and it will sort  in an ascending order

 

Spoiler
unique values.png

 

 

 

0 Kudos
Message 3 of 3
(1,318 Views)