LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String value, research and replace

Solved!
Go to solution

Hi everyone,

 
I need help with a new project who I'm going to explain below.
In this project I have as input a string where the header is '00', the other elements are the position of '00' or proper value. The first element after the header is the position of the first '00', in that position there is the next '00' position and goes on for the entire string. 
I need to check the whole string, find the position and replace them with 00. Below there is an example which explain the operations.
00 05 F1 04 01 04 01 01 01 06 02 01 06 03 01 03 FF 02 01 02 0A
          F1 04 01 04 00 00 00 06 02 01 06 03 01 00 FF 02 00 00 0A
 
I realized a vi (the file is in attachment) where I can find and replace the first zero but I can't find a way to have an iteration for the whole string.
Can anyone help me?
Thanks in advance
Antonio
 
0 Kudos
Message 1 of 3
(1,716 Views)
Solution
Accepted by topic author Antonio81

Hi,

If think you forgot to replace 06 in the exemple.

Please correct me if I am wrong. You want to replace all the positions by 00. Each position giving the next position.

Starting at 05, next position to replace is 01. Next is 01, then 01, then 06,...

 

00 05 F1 04 01 04 01 01 01 06 02 01 06 03 01 03 FF 02 01 02 0A
          F1 04 01 04 00 00 00 06 02 01 06 03 01 00 FF 02 00 00 0A ...

 

I attach a solution

Yddet

0 Kudos
Message 2 of 3
(1,692 Views)

Hi,

 

thanks a lot for your help.

BTW you're right I made a mistake because I miss '06'.

 

Your solution is exactly what I want.

Regards

Antonio

0 Kudos
Message 3 of 3
(1,675 Views)