10-15-2013 08:35 AM - edited 10-15-2013 08:40 AM
Hi All,
I would like to extract numbers (the data) obtained from a serial acquisition which will be shown in multiple line of strings:
$#pressure 20
!@temperature 100
#voltage 1.2
I want to extract 20,100 and 1.2 so that I can do further data manipulation. Should I use match regular expression ? I could not get a proper regular expression to extract the numbers.
Thank you !
Solved! Go to Solution.
10-15-2013 08:43 AM
There are several scan/match functions on the Strings palette. Match Pattern would probably fit your purposes best.
Cameron
10-15-2013 08:59 AM
i used the format, but i am sure you can use regex...
10-15-2013 09:19 AM
Hi there! Yes your method works, but it would be better if we can keep all the data into an array separated to pressure, temperature and voltage since we are continuously acquiring data.
Can we put it into array ?
Pressure Temperature Voltage
20 100 1.2
21 101 1.2
10-15-2013 09:35 AM - edited 10-15-2013 09:37 AM
@pokerprof wrote:
Hi there! Yes your method works, but it would be better if we can keep all the data into an array separated to pressure, temperature and voltage since we are continuously acquiring data.
Can we put it into array ?
Pressure Temperature Voltage
20 100 1.2
21 101 1.2
Whose method? You don't say who you are referring to (and if you don't quote at least part of a message, we don't know unless you tell us).
This is no time to keep your cards close to your chest, pokerprof
.
Cameron
10-15-2013 09:43 AM
Hi Cameron,
Haha I am referring to apok's method. 🙂
Attached is a sample VI that I use according to your method but I have yet able to put the data into arrays. Looking forward to your royal flush !
10-15-2013 09:53 AM - edited 10-15-2013 09:56 AM
you can apply this method...btw, you never said anything about an 'array' ![]()
and if i had not read your mind again....you can put header strings and make it a 2d string array
10-15-2013 10:03 AM
pokerprof, I'd love to see what you've done, but could you send it up in LV 2012 format (many of us have not upgraded yet to 2013)? Thanks.
Cameron
10-15-2013 10:38 AM
as camerond said...can you please post the vi in a lower version?
thanks!
10-15-2013 11:03 AM
Hi guys,
Attached here is the block diagram.
I am using regular expression to extract the value at the end of each string.
I would like to put the value to their respective parameters (pressure,temperature etc.) under an array so that I can do further manipulation with the values.
Note that the values will be acquired continuously from a serial acquisition port.
Hope this is clear and thanks for ye helppp !![]()