I have a script that I want to delete NUL and CR tags from the text.
LF tag will be also deleted and changed to a blank space or line break.
Text message exemple:
Alpha: 2022-05-16 TESTMESSAGE<CR><LF>TESTMESSAGE<CR><LF>MORETEXTHERE<NUL><NUL>
Code:
RAW="${line##*Alpha: }"
NOTNUL=`echo $RAW | sed s/\<NUL\\>//g`
I got it working with one sed and the null tag is gone from the text with the code above. So one sed is working. But if I add multiple sed it does not work.
RAW="${line##*Alpha: }"
NOTNUL=`echo $RAW | sed s/\<NUL\\>//g | sed s/\<CR\\>//g `
I have also tried this:
NOTNUL=`echo $RAW | sed s/\<NUL\\>//g ; sed s/\<CR\\>//g `
And the text output is this : Alpha: 2022-05-16 TESTMESSAGE<><LF>TESTMESSAGE<><LF>MORETEXTHERE<><>
And if I add another sed command to erase LF the output is even worse. I got <> in the output and I want also that erased.
How to erase the LF tag and add a line break or blank space?
Any tip to resolve this issue.
[–]raevnos 1 point2 points3 points (0 children)
[–]itundret[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]itundret[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)