0

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

null
    • Fred
    • 3 yrs ago
    • Reported - view

    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","é").

    • Addinsell
    • 3 yrs ago
    • Reported - view

    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.DC89085F-8FCF-40AD-A509-F617CCF7AD35

    • Fred
    • 3 yrs ago
    • Reported - view

    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?

    • Addinsell
    • 3 yrs ago
    • Reported - view

    I tried :

     replace(Famille, "ae", "é").

     I got :

     "Expression does not return a record :replace(Famille,"ae","é") on the line 1 column 28"

    • Fred
    • 3 yrs ago
    • Reported - view

    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.

    • Addinsell
    • 3 yrs ago
    • Reported - view

    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 ?

    • Fred
    • 3 yrs ago
    • Reported - view

    If you only want "Ara" then you would do =.

    • Addinsell
    • 3 yrs ago
    • Reported - view

    Thanks Fred.

    I tried 

    =Ara

    ="Ara"

    I got all the Ara and even all the Araçari and Araponga 19EB8B08-380A-4525-A050-C237213654F1!

    • Addinsell
    • 3 yrs ago
    • Reported - view

    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"… ?

    • Fred
    • 3 yrs ago
    • Reported - view

    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

    • Addinsell
    • 3 yrs ago
    • Reported - view

    Yes, Fred.

    (I thought about "includes" or "contains" but I can't make them work…)

    • Fred
    • 3 yrs ago
    • Reported - view

    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

    • Addinsell
    • 3 yrs ago
    • Reported - view

    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"

    • Fred
    • 3 yrs ago
    • Reported - view

    No need for [] around the field name. Also check your spelling on line 3.

    • Addinsell
    • 3 yrs ago
    • Reported - view

    Yes, you wrote it in French, I translated :

    I replace "si" by "if" and "alors" by "then".

    And that works.

    Thanks a lot again.

    • Fred
    • 3 yrs ago
    • Reported - view

    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.

    • Addinsell
    • 3 yrs ago
    • Reported - view

    You are right : I used a translator…

Content aside

  • 3 yrs agoLast active
  • 17Replies
  • 854Views