Replace all the end of words "XX" by end "Y" ?
Hi
Could someone tell me how could I replace all the end of words "ae" by end "é" ?
Ex
Ciconidae > ciconidé
Aramidae> Aramidé
Columbidae > Columbidé
Falconidae> Falconidé
Thanks
17 replies
-
Is this more error correction or is this a functional need? If it is error correction then just do what you did for the misspellings.
If it is functional, then the replace function. replace(field name,"what to look for","what to replace with"). replace(Ordre,"ae","é").
-
Thank you Fred.
It is functionnal.
The name of my column is "Famille"
So I create a field formula in wich I typed :
replace(Famille, "what to look for", "what to replace with"). replace(Famille, "ae", "é").
I got this error :
"Expression does not return a record :replace(Famille, "what to replace with") on the line 1, column 61"
Thanks to tell me what I should change.
-
You copied too much of my sentence. You only need one replace function. You need to remove one of them, which one do you think you should remove?
-
I tried :
replace(Famille, "ae", "é").
I got :
"Expression does not return a record :replace(Famille,"ae","é") on the line 1 column 28"
-
Remember that putting a period at the end of a function tells Ninox to look for a record. Please make sure you check puncuations, especially when you copy and pasting from the website.
-
Thanks a lot Fred, I'll try to remember it !
It works well.
About the same kind of idea, maybe you could help me.
About the conditional styling.
Among a list of perrots I have :
Ara
Araçari
If I use the conditional styling and choose to color Ara,
There is :
=
!=
Begin with
End with
Countain
f(x)
I select "begin by" Ara : Ara and Araçari will be colored, not only Ara.
IBit I should like to color only Ara.
With the formula f(x) I maybe could create a function but wich one ?
How can do that ?
-
If you only want "Ara" then you would do =.
-
Thanks Fred.
I tried
=Ara
="Ara"
I got all the Ara and even all the Araçari and Araponga !
-
Sorry…I made a mistake : that works well, thanks
What if I would like to get only Ara with another word next to it, like :
"Ara bleu", "Ara rouge", "Ara vert"… ?
-
Just to be clear, do you only want fields that start with the word Ara and have other words after it. You want to ignore words that only have Ara in the field?
so
Ara bleu would be a positive
Ara would be a negative
blue Ara would be a negative
red Ara white would be a negative
-
Yes, Fred.
(I thought about "includes" or "contains" but I can't make them work…)
-
One way is:
1) first check if "Ara " (space included) is at the beginning. So we would use the substring function to pull out the first 4 characters:
let xBegin := substring([field name],0,4) <--we start at the beginning, 0, then go to 4 so we capture Ara and the one space after.
2) then we set one more variable:
let xLen := length([field name]) <-- we need to know the length of the text in the entire field
3) then we check if it matches "Ara " (space included)
if xBegin = "Ara " then substring([field name],4,xLen) end <--as per you specifications you will only want words that start with Ara so we know the 2nd word will always start at the 4 block (when starting from 0). This also leaves the field blank if it doesn't match. You can put your own else if you want.
So your formula field would look something like this:
let xBegin := substring([field name],0,4)
let xLen := length([field name])
if xBegin = "Ara " then substring([field name],4,xLen) end
-
Thanks Fred.
So I key in :
let xBegin := substring([Nom],0,4)
let xLen := length([Nom])
si xBegin = "Ara " alors substring([Nom],4,xLen) end
I get this :
"The function is not defined : substring([string],number,number) on the line 2,column 3"
-
No need for [] around the field name. Also check your spelling on line 3.
-
Yes, you wrote it in French, I translated :
I replace "si" by "if" and "alors" by "then".
And that works.
Thanks a lot again.
-
I'm sure you ment I wrote it in English. :) Otherwise I didn't know I was literate in French all of a sudden.
It looks like all formula code has to be in English, so it is best not to put them through a translator.
-
You are right : I used a translator…
Content aside
- 3 yrs agoLast active
- 17Replies
- 861Views