LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Choos the section of the sorted string array and put it at the start

Solved!
Go to solution

Hi All,

 

I have a sorted string array (see ataached) which contain strings, numeric as T1-1,T1-2.....T8-1,T8-2...T32-1.What I want to do is to be able to select the completeT8 and T9 parts and put it at the start of the array keeping remaining array sorted.Is there a way to do this. I am trying to match and replace but getting confused in its usage.

Thanks for the help.

 

Ankit G

0 Kudos
Message 1 of 7
(3,214 Views)

First you need to search to find the desired range.  I recommend a hidden gem in vi.lib.  It can be found at LV folder\vi.lib\AdvancedString\Match 1D String Array.vi.  Disclaimer:  using undocumented VIs in vi.lib can be dangerous and not always carried over from LV version to LV version.

 

So with this guy, you can search for the beginning of your T8 range.  You can do the same for the T9 and/or T10.  With these indecies, you can pick out your range, delete them from the original array, and append to the front of the array.


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 7
(3,208 Views)

A solution below.

 

Teeth Sort.png

0 Kudos
Message 3 of 7
(3,201 Views)

@SLee2004 wrote:

A solution below.

 

Teeth Sort.png


Hi Sum,

 

Thanks, but the code remove all the other strings T1,T2...T7, and it repeats the T8s and T9s.

 

0 Kudos
Message 4 of 7
(3,189 Views)

AnkitG wrote:

but the code remove all the other strings T1,T2...T7, and it repeats the T8s and T9s.


As I said before, you need to find the range of the T8s and T9s and delete them from the original array.  With the given VI, you can use the index information to figure out this range.


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 5 of 7
(3,186 Views)
Solution
Accepted by topic author AnkitG

The "Tooth Strings (out)" contains your original sorted array "Tooth Strings (in)" with T8 and T9 at the beginning.  There is no deleted elements or repeated elements. Attached is the code.

0 Kudos
Message 6 of 7
(3,173 Views)

@crossrulz wrote:

AnkitG wrote:

but the code remove all the other strings T1,T2...T7, and it repeats the T8s and T9s.


As I said before, you need to find the range of the T8s and T9s and delete them from the original array.  With the given VI, you can use the index information to figure out this range.


Thanks a lot, i am able to delete the part of the array and append it to front.

 

0 Kudos
Message 7 of 7
(3,168 Views)