LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Remove unused characters from string

Solved!
Go to solution

Hi, I try to remove unused characters from a string, but I can't find a function to do that.

 

The string like: 0000 0000 0000 0000 0000 0000 0130 3130 3030 3030 3004 0000 0000 0000 0000 0000 0000 0000 ,  I need the characters from 01 to 04.

 

I need some tips.

 

 

0 Kudos
Message 1 of 7
(5,765 Views)

String subset?

 

(Is your example string displayed in hex?)

0 Kudos
Message 2 of 7
(5,763 Views)

First, what defines an "unused character"?  Are all the unused characters 00? Can 00 ever occur in the desired data?  Are the characters 01 and 04 always the first and last characters? Can either of those characters occur in the data?

 

Removing characters is not difficult.  There are several string and array functions which may be used.  To decide which to use and how to use it, the decision making porcess muct be defined first.

 

Lynn

0 Kudos
Message 3 of 7
(5,761 Views)

yes, 0x00 and \00, NULL character. the string I posted is in Hex mode.

0 Kudos
Message 4 of 7
(5,758 Views)

yes,unused characters are  0x00 and \00, NULL character  the string I posted is in Hex mode.

0 Kudos
Message 5 of 7
(5,743 Views)

You could use Search and Replace String to remove the null characters.  It doesn't help if you have valid nulls within your data, but it's a start.

 

Example_VI.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 6 of 7
(5,720 Views)
Solution
Accepted by topic author concorpoly

If the characters between the SOH and EOT did have an NULL, then Match Regular Expression might be a choice:

 

Find \x01, find anything BUT \x04, then find \x04

 

 

SOH - EOT.JPG

 

 

 


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Message 7 of 7
(5,716 Views)