Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Replace /N with empty string in CSV File

avatar
Explorer

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.

1 ACCEPTED SOLUTION

avatar
Explorer

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

110187-replacetext.png

View solution in original post

5 REPLIES 5

avatar
Master Mentor

@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

avatar
Explorer

This was helpful

avatar

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.

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.

avatar
Explorer

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

110187-replacetext.png

avatar
Master Mentor

@FA

Great that your problem was resolved.