From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

extracting columns from 2D string array according to first element of each column

Solved!
Go to solution

Hi,

 

I have a 2D string array and I want to extract columns from it according to the string value of on of the elements in each column to formulate a new 2D array. for example: 

 

 

in the attached excel sheet a 2D array. I want to extract the whole columns contain "CA/S-" string and "MS/S+" to formulat another 2D string array formed of the columns that contain only those 2 string values.

 

Thanks a lot and I would reaally apperciiate any input 🙂

 

Cheers,

Mostafa

0 Kudos
Message 1 of 11
(4,367 Views)
Solution
Accepted by topic author Nashaat

Something like this?  I had to convert your Excel file into a CSV.


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 11
(4,363 Views)

If performance is a concern, here's a solution that operates "in place". Modify as needed.

 

 

0 Kudos
Message 3 of 11
(4,346 Views)

Thanks a lot. That's exactly what i was looking for Smiley Happy

0 Kudos
Message 4 of 11
(4,299 Views)

Dear Mr. Altenbach,

I'm a beginner in using LabVIEW with datafile.

It would be usefoul for me to have the vi code of your example so I will have a starting point for work on my application.

I need to sure identify the used function to avoid misfunction due to wrong connection for the starting point.

 

Thak you a lot in any case.

 

Best regards.

0 Kudos
Message 5 of 11
(4,180 Views)
Transpose array, index array, replace array subset, array subset.
For loop, case structure, shift register.
Try it!
0 Kudos
Message 6 of 11
(4,163 Views)

e.carano wrote:

I'm a beginner in using LabVIEW with datafile.


If you want code, you need to tell us your LabVIEW version.

 

If you have a recent version, you can use a conditional tunnel to simplify the code even more. (see attached 2014 version).

 

Download All
0 Kudos
Message 7 of 11
(4,154 Views)

Thank you for your suggestion, I find a way using a similar solution.

I'm using LV 2011.

 

Best regards.

0 Kudos
Message 8 of 11
(4,145 Views)

@e.carano wrote:

Thank you for your suggestion, I find a way using a similar solution.

I'm using LV 2011.


LabVIEW 2011 does not have the conditional tunnel.

0 Kudos
Message 9 of 11
(4,142 Views)

altenbach ha scritto:
Transpose array, index array, replace array subset, array subset.
For loop, case structure, shift register.
Try it!

Sorry, I was referring to your first suggestion.

 

Best regards.

0 Kudos
Message 10 of 11
(4,138 Views)