I have a very specific need, for which I've been trying to solve, without success.
I have a log, which is created by a dump of a tcp/ip socket... It converts the Hex to ASCII, but naturally there are some special characters in it.
I've managed to remove them, but I'm currently experiencing a difficulty: Sometimes, an 0x0A is sent, which messes with my applications... I'm trying to remove it, but then it also removes the valid 0x0A at the end of the line...
Basically, I have, in the log file:
08-14-2017 10:00:00 String={Teste String}
08-14-2017 10:00:00 String={
Teste String2}
08-14-2017 10:00:00 String={
Teste String3}
08-14-2017 10:00:00 String={Teste String4}
I want the final result as
08-14-2017 10:00:00 String={Teste String}
08-14-2017 10:00:00 String={Teste String2}
08-14-2017 10:00:00 String={Teste String3}
08-14-2017 10:00:00 String={Teste String4}
The characters are always between {}, so every 0x0A after the } is valid, but inside is not.
every command I've tried either removes all the 0x0A, or just not work at all.
I've tried things like
sed 's/^[^}]*}//'
sed 's/\x0A$//'
any thoughts?