LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String Extraction

Hi Friends,

 

I've a small task need to done in LabView and related to String function in LabVIEW.

 

I have a line of string data a

"ALex.123 Steve.123 ramco.123..........."

Each line not being a constant length.

 

I need to extract each name and store them in an array.

Can anybody please suggest which is the correct function in LabVIEW i should use?

 

Regards,

Suneel.V

0 Kudos
Message 1 of 13
(3,546 Views)

Hi Suneel,

it seems that all characters are part of your names, so you can use match pattern.

 

 

Hope it helps.

Mike

Message Edited by MikeS81 on 02-12-2009 01:35 PM
Message 2 of 13
(3,540 Views)

Hi Mike,

 

What should be there in the TRUE case?

Because its continous RUN state when i tried this method?

Actually i am trying to do it using Scan token string function in LabVIEW?

 

Please reply back what need to be kept in true case?

 

Suneel.V

0 Kudos
Message 3 of 13
(3,530 Views)

Hi Suneel,

the true case contains only a connection from "array in" to "array out". If there is also a name at the end of your input string, then you have to add in this case the "after .." string to the array.

 

Mike

Message 4 of 13
(3,526 Views)

Hi Suneel,

 

Do you mean that you need something that will handle the case where the last name does not have an extension?

If so, then have a look at the attached example.

 

Carefully examine the code and please ask questions, because the solution provided by Mike was very close to what you needed, which means you do not understand what the code does and how it does it.

 

R

Message 5 of 13
(3,521 Views)

Does the string between the names remain constant??

Like the .123 remains constant in the example string provided by you.

 

If that is the case I would have got the names array according to below attached VI.

I dont know if someone can give better method than this.

0 Kudos
Message 6 of 13
(3,517 Views)

Thanks for the example krunal,

 

Unfortunately, Suneel did not provide precise specifications at how the program should handle exceptions or various line patterns, so we all have to guess.

 

R

Message Edited by RayR (aka JoeLabView) on 02-12-2009 08:56 AM
Message 7 of 13
(3,505 Views)
Use Spreadsheet String To Array. Since each name is ended with a ., use
".123 " as delimiter. Use a 1D array of strings as array type, %s as format
string. You'll get an array of names as a result.


Message 8 of 13
(3,495 Views)

Hi Wiebe,

 

I would have suggested the same thing, except that there seems to be an additional requirement which is to handle names that do not have the same type of extension or no extension at all...  Unless I misread the post after Mike provided an example solution..

 

R

0 Kudos
Message 9 of 13
(3,488 Views)

suneelkv wrote:

Hi Mike,

 

What should be there in the TRUE case?

Because its continous RUN state when i tried this method?

Actually i am trying to do it using Scan token string function in LabVIEW?

 

Please reply back what need to be kept in true case?

 

Suneel.V


 

Okay.. I think I misread.. 

I thought that when you ran it that the loop did not stop..  "Because its continous RUN state when i tried this method?"

 

The answer is that the TRUE case should only pass the array wire through.  So just pull the array wire from the left to the right tunnels.

 

A cleaner solution if all your names have the same extension is to do what Wiebe suggested.

 

Sorry for the confusion.

 

R

0 Kudos
Message 10 of 13
(3,485 Views)