Customer Portal

Running replace function on entire flatfile

Comments 1

  • Avatar
    Ladislav Szabo
    0
    Comment actions Permalink
    Hello there!

    I see two answers to your question.
    In first one you only need FlatFileReader and FlatFileWriter.
    1. Right click on FlatFileReader with linked file and select "Extract metadata"
    2. Click "Next" and in "Quote character:" dropbox choose quotes and click "Finish"
    3. In FlatFileWriter set "Quoted strings" attribute to "false"

    When you run the graph data should be written now without the quotes.

    Second solution utilizes "Reformat" component. There you read whole file as one record and use "replace" function
    to get rid of the quotes.
    1. Create new metadata with one field
    2. Click on the record and delete values from "Record delimeter" and "Default delimeter"
    3. Set "EOF as delimeter" in "Advanced" to true
    4. In "Reformat" component use "replace" function
    e.g. $out.0.field1 = replace($in.0.field1,"'","")

    I've attached a file with above mentioned solutions so you can have a look.

Please sign in to leave a comment.