02-12-2009 06:13 AM
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
02-12-2009 06:34 AM - edited 02-12-2009 06:35 AM
Hi Suneel,
it seems that all characters are part of your names, so you can use match pattern.
Hope it helps.
Mike
02-12-2009 06:51 AM
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
02-12-2009 06:57 AM
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
02-12-2009 07:23 AM
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
02-12-2009 07:25 AM
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.
02-12-2009 07:55 AM - edited 02-12-2009 07:56 AM
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
02-12-2009 08:10 AM
02-12-2009 08:24 AM
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
02-12-2009 08:28 AM
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