LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Replacing double quotes in text

    Employee
    Posted 11-16-2011 13:56

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: rpcwong

    How do I replace and get rid of double quotes in text fields? I know how to do it with any other characters but since we use " " in the replace function, I don't know how to do this...


  • 2.  RE: Replacing double quotes in text

    Employee
    Posted 11-16-2011 14:04

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: timonk

    Good Day,

    You need to use the escaping backslash in the Replace function.

    For example:

    emit replace(junk,"\"", "@") as "updated junk"

    In a filter this code will replace the 'junk' column with a column called 'updated junk' where all double quotes have been replaced by the @ symbol.

    Regards,
    Timon Koufopoulos
    MDS Lavastorm Support.



    Copy and paste the following 2 nodes into a graph, to see what I mean:

    node:Filter
    bretype:core::Filter
    editor:sortkey=4ec421652d675869
    input:@40fd2c74167f1ca2/=Static_Data.40fe6c55598828e5
    output:@40fd2c7420761db6/=
    prop:Script=<<EOX

    emit replace(junk,"\"", "@") as "updated junk"

    EOX
    editor:XY=560,460
    end:Filter

    node:Static_Data
    bretype:core::Static Data
    editor:sortkey=4ec4213a37ae47b5
    output:@40fe6c55598828e5/=
    prop:StaticData=<<EOX
    junk:string
    my name is "bob"
    EOX
    editor:XY=380,460
    end:Static_Data


  • 3.  RE: Replacing double quotes in text

    Employee
    Posted 11-16-2011 14:09

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: rpcwong

    I didn't know about the backslash escape character. This is exactly what I need. Thanks!