09-17-2010 03:39 AM
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
Solved! Go to Solution.
09-17-2010 03:46 AM
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
09-17-2010 07:57 AM
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.
09-17-2010 08:14 AM
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
09-17-2010 08:36 AM
@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
09-17-2010 09:04 AM
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
09-17-2010 09:07 AM
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
09-17-2010 09:47 AM
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
09-17-2010 10:00 AM
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).
09-17-2010 10:12 AM
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