취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

remove odd spaces from hex string

해결 완료!
솔루션으로 이동

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 포인트
1/8 메시지
5,787 조회수

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
2/8 메시지
5,775 조회수

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 포인트
3/8 메시지
5,757 조회수

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 포인트
4/8 메시지
5,740 조회수

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

5/8 메시지
5,725 조회수
솔루션
승인자 hiNI
Try this 8.2 version.
------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
6/8 메시지
5,713 조회수

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 포인트
7/8 메시지
5,704 조회수

 


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 포인트
8/8 메시지
5,693 조회수