LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

remplacer un texte commencant par <0,00--- dans un tableau de texte

Solved!
Go to solution

Bonjour à tous,

J'ai besoin de remplacer un texte commencant par <0,00-- (ce qui veut dire que je ne connais pas la fin) par 0. Ce remplpacement a lieu dans un tableau de texte 2D ou 1d c pareil pour moi.

Pouvez vous m'aidez

 

Ben

0 Kudos
Message 1 of 18
(3,394 Views)

 I would like be able to replace a string which is starting by <0,00-- inside my string array, which can be 2d or 1d

 

Can you help me

 

BEN

0 Kudos
Message 2 of 18
(3,388 Views)

You should be able to use the Search and Replace function located in the Strings palette.

 

Are you having difficulty to find the <0,00 within the array?  There is also a search function within the Array palette.

0 Kudos
Message 3 of 18
(3,371 Views)

HI,

 

Thank you for your answered, the problem is that i d'on't know the end of my string. That means i can't compare string against string.

What i want is scan my array of string to find all the string starting by <0,000, then -- 2digits. And then remplace all the digits of my string by 0

example

<0,00030 give me 0

<0,00066 give me 0

then if i can managed to be able to do somethings like: Ben----- =0

Example

Karim          Mathieu            Pawel           Benjamin

give me 

Karim          Mathieu            Pawel           0

 

I hope you understand me better.

BEN

 

 

 

0 Kudos
Message 4 of 18
(3,367 Views)

@Bigben84 wrote:

HI,

 

Thank you for your answered, the problem is that i d'on't know the end of my string. That means i can't compare string against string.

What i want is scan my array of string to find all the string starting by <0,000, then -- 2digits. And then remplace all the digits of my string by 0

example

<0,00030 give me 0

<0,00066 give me 0

then if i can managed to be able to do somethings like: Ben----- =0

Example

Karim          Mathieu            Pawel           Benjamin

give me 

Karim          Mathieu            Pawel           0

 

I hope you understand me better.

BEN

 

 

 


So to claify that last part...

 

If you know how to handle the "<0,00030 give me 0" then you will be able the similar challenge of find a string like "Ben" inside the word Benjamin and able to handle that as well.

 

is that correct?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 18
(3,361 Views)

Yes

What i want is looking for the starting of a string and replace the string by 0 but i want replace all the part of the string find. so looking for all string starting by ben and replace them by 0

Inside an array of string

 

BEN

0 Kudos
Message 6 of 18
(3,356 Views)

Since you do not know how long the string to replce will be, you will have to find a way to determine where the replacable part ends. I'm thinking a two step process...

 

1) If I find the first part then look for the end.

 

What ever is in-between is what gets replaced.

 

So...

 

What will be the delimiter defining wher ehte replacable stuff ends?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 18
(3,354 Views)

In fact for my application now i know the shap of my string. it's < 0,00030. but the two last number are not stable. It can be 66 or 99. so i would like replace the string starting as < 0,000-- by 0

BEN

 

 

0 Kudos
Message 8 of 18
(3,347 Views)

Actually, there's a couple of ways..

One thing that comes to mind is using a regular expression to find and replace.  Just as was recently shown to me here:

http://forums.ni.com/t5/BreakPoint/Regular-Expressions-Board/m-p/1247126#M14096

That would work if you are dealing with the data in it's raw form and not being inserted into an array.

 

If the data is already in an array, you can have a look and search the indexed array element for a match and immediately replace the corresponding element with 0 (or replace the matching string within the element with 0).

 

0 Kudos
Message 9 of 18
(3,340 Views)

Oki,

 

Thank you very much, but it's to fast for me

how can i match something i don't know. What i know is the beginning of the string i want replace by 0.

So how do i have to do?

 

it's very nice from you to take tiùme to answer me, i really appreciate.

 

BEN

0 Kudos
Message 10 of 18
(3,335 Views)