field.replace("this","that") as newfield

Comments

2 comments

  • Avatar
    Adrian Williams

    Hi Thomas,

     

    If the intention is to output a single field where all the prefixes have been stripped from the values in the 'Office' field then you can just chain the replace() statements, e.g.

    FOffice = Office.replace("Proffice-", "").replace("PIL-", "").replace("Care Läkar-","").replace("Care Läkar -","").replace("PS-","")

    emit *, FOffice

    If you really want to output separate fields for each new field (AOffice - EOffice) then you could use this script:

    AOffice = Office.replace("Proffice-", "")
    BOffice = AOffice.replace("PIL-", "")
    COffice = BOffice.replace("Care Läkar-","")
    DOffice = COffice.replace("Care Läkar -","")
    EOffice = DOffice.replace("PS-","")


    emit *, AOffice, BOffice, COffice, DOffice, EOffice

     

    Regards,

    Adrian

    0
    Comment actions Permalink
  • Avatar
    Thomas Ljungström

    Thanks!

    0
    Comment actions Permalink

Please sign in to leave a comment.



Powered by Zendesk