I've been trying to do this half of the day and it's like I haven't come a single step further, so I hope you guys can help me with my problem:
I have a text file that contains strings that should not be there and which I want to delete automatically from the command line. The character string always consists of two characters, beginning with the hex value "01" (e. g."01 90").
My task is therefore:"search for HEX value 01 and delete this and the following HEX-value". However, I'm too stupid for this task...
Can anyone help me or give me a suggestion which command I need? I've tried tr and sed so far..
A bit more information would be great, particularly an input sample, or, for your special problem, a hexdump ( od -tx1c file ) of it. And, your attempts, even though they failed, for analysis and discussion.
LC_ALL=C sed "s/[\x01].//g" text_file > fixed_text_file
Testing example:
$ printf "Test:%b%b\n" "\x1" "\x90" | od -c
0000000 T e s t : 001 220 \n
0000010
$ printf "Test:%b%b\n" "\x1" "\x90" | LC_ALL=C sed "s/[\x01].//g" | od -c
0000000 T e s t : \n
0000006