05-04-2017 01:34 PM
I am reading a series of data strings from a serial port. RS-232.
Bellow is an example of the data coming in.
[2h[2J[1;1H[12;15H[2KROM TEST IS IN PROGRESS ... PLEASE WAIT [2J[1;1H[3;60H[2KVERSION 8
I would like to look for and delete everything up to and including 2K then look for the next instance of and delete to 2K.
Rinse and repeat.
Ideally the string would end up as;
ROM TEST IS IN PROGRESS ... PLEASE WAIT VERSION 8
Solved! Go to Solution.
05-04-2017 01:46 PM - edited 05-04-2017 01:46 PM
Match Pattern is your friend...
05-04-2017 01:48 PM - edited 05-04-2017 01:49 PM
I would like to look for and delete everything up to and including 2K then look for the next instance of and delete to 2K.
You need to state your rule differently.
As written, your rule will leave nothing except "VERSION 8".
In any case, MATCH PATTERN and MATCH REGULAR EXPRESSION will do things along this line.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
05-04-2017 01:55 PM - edited 05-04-2017 01:56 PM
How did you come up with '\1B" ?
I don't see that in the original string he posted:
Blog for (mostly LabVIEW) programmers: Tips And Tricks
05-04-2017 01:59 PM
Thanks. I had tried something similar to this but couldn't get that initial string correct.
05-04-2017 02:00 PM - edited 05-04-2017 02:01 PM
1B is the hex for the left arrow symbol .
I kept trying to use the instead of 1B.
05-04-2017 02:03 PM
I don't see the left arrow AT ALL, that's why I said that your written rule was wrong.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
05-04-2017 02:19 PM
@CoastalMaineBird wrote:
I don't see the left arrow AT ALL, that's why I said that your written rule was wrong.
It just appeared in the string when I copied the string from the browser and pasted in a string control. Whether or not the OP is really getting that in the data, that is unknown at this point.
05-04-2017 02:46 PM
Strange. It's perfectly clear to me.
05-04-2017 02:48 PM
It definitely has a left arrow at the beginning.