LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

remove odd spaces from hex string

Solved!
Go to solution

Hello,

 

I would like to remove odd spaces from a hex string and output the result.  This is what the input string will look like:

 

01 00 04 0F FF 36 3B CC...

 

I would like the output to be:

 

0100 040F FF36 3BCC...

 

I obtained the attached labview code from the forum earlier, however it doesn't work with text.

 

Any help is greately appreciated.

 

Thanks,

hiNi.

0 Kudos
Message 1 of 8
(5,485 Views)

String.png

 

 String.jpg

 

Have I got it right?

Message Edited by Giedrius.S on 02-17-2010 07:34 PM
Message Edited by Giedrius.S on 02-17-2010 07:35 PM
---

While evaluating my code please have in mind that I am a LV novice. Therefore sometimes my code might violate some coding rules that I have to learn about myself. But how else could I do that... 🙂

Chart zoom with "Mouse Over" effect
Message 2 of 8
(5,473 Views)

Hi,

 

There is really no need to change the code that much.

 

The case structure is only looking for the characters 0-9 and A-F.  It is clear that the case structure needs to be looking for a-f as well.  The a-f condition in decimal format is 97-102 (what you need to add to the case structure condition), which is 61-66 in hex.  You new condition would be 48..57, 65..70, 97-102.  I have alos attached modified version of your original code. 

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 3 of 8
(5,455 Views)

Hello jyang72211,

 

Can you save your VI to labview 8.2.  I cannot open up your VI to look at your code.

 

Thanks for your help and time.

 

hiNi

0 Kudos
Message 4 of 8
(5,438 Views)

You may want to try out 'Search and Replace String'. The regex is ()_(), notice the space between them.  No space in the replace string.

 

SearchAndReplace.png

Message 5 of 8
(5,423 Views)
Solution
Accepted by topic author hiNI
Try this 8.2 version.
------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
Message 6 of 8
(5,411 Views)

Darin.K,

 

Must admit I'd have never thought to use this function to do this.  Kind of warped my brain at first.  Had no idea Search and Replace String could be this powerfull.

 

Unfortunately code didn't work when I tried it.  Some sort of typo in the search string.  I've attached two variations that do work. 

 

Message Edited by Wayne.C on 02-17-2010 03:30 PM
0 Kudos
Message 7 of 8
(5,402 Views)

 


Wayne.C wrote:

 

Unfortunately code didn't work when I tried it.  Some sort of typo in the search string.  I've attached two variations that do work. 

 

 


 

 

On my iPhone now so no testing, but it did work just fine for me.  As with all of these functions, the regex support varies, but there are a large variety of ones that work.  I was playing a little, so hopefully between the experimenting/saving/snipping I didn't screw it up.

 

Glad to bend your mind, most of us only scratch the surface of the power of Regular Expressions.  

0 Kudos
Message 8 of 8
(5,391 Views)