Using sed
how can i replace \ n with null
How to replace empty space || with NULL.
|200|0||0|\N||^A|0|\N||
desired output
|200|0|NULL|0|NULL|NULL|^A|0|NULL|NULL|
You need a slightly modified version of this . Something like this should work:
sed ':a; s:|\(\\N\)\?|:|NULL|:g; ta'
I think the team you are looking for may be called "tr". Try
tr \\n \\0
cat file | sed 's/\\N/NULL/g' | awk -F\| '{for(i=2;i<=NF;i++){ if($i==""){ printf "|NULL"} else{ printf "|%s", $i}}; printf "|\n"}'
with awk
awk 'gsub("\\\\N","NULL");gsub("\\|\\|","|NULL|")' temp.txt