LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

removing unwanted characters from a string

Hi, basically i'm wanting to remove the following value from a text file below. 18488 is the value, i need to remove the rest of the other unwanted characters first. is there any way of doing this e.g. by ignoring the first few characters of the string and then using decimel to string fuction or is there any other way of getting around this. any help greatly appreciated.

thanks stuart
0 Kudos
Message 1 of 4
(3,302 Views)
One easy way is to use String Subset. Specify the offset and length.
Message 2 of 4
(3,302 Views)
Your string seems to be a fixed-width field list seperated by empty spaces.

I would suggest using the "token" VI to split the string, and assuming the value you want is always in the same place (position 5) then you can simply access it from the array produced. See example.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 3 of 4
(3,302 Views)
It seems to me that this file structure is formatted with fixed-width fields. Simply use the string subset function to slice out what you want.

You don't need decimal-to-string, because it is already a string, right?

Could you clarify a bit more:

What do you mean by "remove"? Do you ...
(1) want to extract the value at the position of 18488 as a number.
(2) Create a new string with this part replaced by blanks?
(3) Create a new string with this part cut out ("removed")?
(4) ??

The example image shows cases (1) and (3) and the resultig output.
Message 4 of 4
(3,302 Views)