LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

(string array indexing)

Shaun
 
You could do something like this
 
 
This demonstrates using the Index Array, Match Pattern and Build Array Functions and shift register to do what you want.
 
Build it up and try it out.
 
cheers
 
David

Message Edited by David Crawford on 10-03-2006 03:56 PM

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

David,

First, I would like to thank you for your support. I went ahead in building a circuit that fits my application using the circuit you sent me. But am stuck at one point. "I'm trying to extract the rows of 2D array corresponding to the all indexes that we get out of the circuit". The circuit I've built doesn't display rows for more than 1 index. I would like to know the correct and the best way to achieve this. Attached is the VI i have now. Thanks once again.

Shaun.

 

 

0 Kudos
Message 1 of 36
(4,285 Views)

Shaun

You should have replied to the original post instead of starting a new thread. I don't get e-mail notification when you start a new thread.

Anyway take a look at this

Give me a shout if you have any questions.

David

Message Edited by David Crawford on 10-05-2006 08:53 AM

Message 2 of 36
(4,255 Views)

David,

The first circuit you gave me works fine and so does the second one.  The cluster approach  you used in the second VI , seems easier than my approach. I am getting all the matching indices of array elements for a given string in a given column.  But, " for each of these indices(matches) I would like to display all of it's corresponding row elements in the main array (preferably in a 2D table) ". Sorry If i wasn't clear in my question in my previous post. Again, I thank you and sincerely appreciate your help.

Shaun

 

 

 

 

 

0 Kudos
Message 3 of 36
(4,224 Views)
Well, you just need to use the array index function to extract the rows found by the column index search, for example ...
 
 
where Match Indices is for the first column.
 
David

Message Edited by David Crawford on 10-06-2006 07:58 AM

Message 4 of 36
(4,208 Views)

David,

Thank you very much. My application is working. I appreciate your kind help. Please continue the good work you are doing to plethora of labview users.

Shaun

0 Kudos
Message 5 of 36
(4,189 Views)
Hi,
 
I'm creating an user interface for my applicaiton. I have a table into which i get the output for display. I was wondering if it is possible to make the table mouse sensitive. Meaning, the user must be able to see a particular cell value in a table upon cliking on any of the table cells.
 
For example, say if I have a 2D table with some data in each cell. Upon clicking any row,(cell), I would like to display its corresponding first column element in that row (in a string).
 
 
Thank you
 
Shaun
 
 
0 Kudos
Message 6 of 36
(4,159 Views)
Shaun
 
You could do it in an event structure using the Mouse Down event like this
 
 
 
David

Message Edited by David Crawford on 10-16-2006 08:24 AM

Message 7 of 36
(4,148 Views)
Hi David,
 
    I have two questions regarding,Programing with listboxes and Parsing txt files.
 
    Firstly,I have used a list box instead of a table to output a particular cellvalue from a selected row.
    The current code what I have does the job of displaying the cell content(model name) as an error
    message,upon clicking on any row (during run time). Please refer to the attachment "arrayindex3.vi"
    and FakedataV3.txt. I would like to be able select/unselect more than one row and have a display of
    cell contents(model names) as an array. This display shall be a pop up feature.(in a separate vi/subvi)
 
    Secondly, I have text file generated from simulation of different models. There are a few items that I 
    need to parse from these files. The sample data is as shown in the attachment(Parsing.doc). Please
    take a look at the attached word document(with explaination) and let me know the best way to do it.
   
    I  Appreciate your help.
 
    Thank you very much
 
    Shaun
 
Download All
0 Kudos
Message 8 of 36
(4,082 Views)
Shaun
 
I have attached an example to tackle your first question.
 
For your second question It would have been better if you attached the simulation file also. Could you do that?
 
For this I would read in the text file as lines then feed that into a for..loop.
I would then look in each line for the unique marker.
If the marker is # text id I would use that to append 1D string array of size 7 to an empty 2D array string. Use text id as you row index for your table array.
When you find a marker use string subset up to before the # marker along with trim string to remove any trailing spaces.
Each marker will have an column index from 0 to 6 and you will use that with replace array subset on the 2D string array that are building.
 
David
Message 9 of 36
(4,052 Views)
Hi David,
 
Here's the simulation file that you wanted to have a look at. Note that certain text ids dont have fields( like "bit", "Hi or Lo"), in which case these fields can be blank(in the final array).  Can I get the dynamic data (array size) to reflect out of the while loop ...?(  Pick Models From MCListbox.vi ).
 
 
Thank you very much
 
Have a nice day
 
Shaun

Message Edited by Support on 11-15-2006 01:12 PM

0 Kudos
Message 10 of 36
(4,026 Views)