Skip to main content
aridif
Gold ⭐️
August 3, 2019
Solved

Replace /N with empty string in CSV File

I have a CSV file in which nulls are represented by "/N". How can i go about replacing this with an empty string ''.

Sample

Year Age City Date

2013 \N London \N

2019 56 \N \N

2015 20 \N 12/12/2019


I would like to replace this, so that the file looks like the below.

Year Age City Date

2013 London

2019 56

2015 20 12/12/2019


Which processors can i use to achieve this and what is the syntax to be used.

    aridif
    aridifAnswer
    Gold ⭐️
    August 4, 2019

    I was able to solve the problem by using ReplaceText processor below. For Replacement Value, I hit "tab"

    110187-replacetext.png

    5 replies

    Shelton
    Gold ⭐️⭐️⭐️
    August 3, 2019

    @FA

    Use a ReplaceText processor which replaces \A\n|\n*\s*(?=\n) with '' (empty replacement value). The search regex looks for:

    \n*\s*(?=\n) - newline (0 or more) followed by whitespace (0 or more) followed by a newline.

    110192-1564787672770.png

    Translate
    aridif
    aridifAuthor
    Gold ⭐️
    August 4, 2019

    This was helpful

    Translate
    ask_bill_brooks
    Platinum ⭐️
    Platinum ⭐️
    August 3, 2019

    The above question and the entire response thread below were originally posted in the Community Help track. On Sat Aug 3 14:59 UTC 2019, a member of the HCC moderation staff moved it to the Data Ingestion & Streaming track. The Community Help Track is intended for questions about using the HCC site itself.

    Translate
    Bill Brooks, Community Moderator Was your question answered? Make sure to mark the answer as the accepted solution. If you find a reply useful, say thanks by clicking on the thumbs up button.
    aridif
    aridifAuthorAnswer
    Gold ⭐️
    August 4, 2019

    I was able to solve the problem by using ReplaceText processor below. For Replacement Value, I hit "tab"

    110187-replacetext.png

    Translate
    Shelton
    Gold ⭐️⭐️⭐️
    August 4, 2019

    @FA

    Great that your problem was resolved.

    Translate