Goodmorning,
I have MKS Toolkit (K-Shell) running on a windows server. On it I have a c program that in a true unix environment works fine, but here it adds an extra '0000000000000016000A' in various places in the file that the c program produces that I need to remove.
Here is what the file looks like when I pg it:
00000000000000840022003A00013A40313A98263A013AF63AF2423AF03AF2423AF03A13043A0705163A08233A20513AF03AF53A113AF0
00000000000000840022003A00013A26983A98273A013AF73AF4903AF03AF4903AF03A26983A0705163A12063A20493AF03AF73AF63AF0
00000000000000840022003A00013A26983A98283A013AF53AF1073AF03AF1073AF03A26983A0705163A13283A20483AF03AF13A123AF0
Note that the length of the line exceeds the width of the screen and pg simply does not display the rest of the line; this file shows 17 very long lines.
From the windows environment, here is what it looks like when I use notepad:
000000000000004C0022163A000000003A00013AF03AF03AF03AF6103A08023A070516220A
0000000000000016000A
000000000000004C0022163A000000003A00033AF03AF03AF03AF6083A08033A070516220A
0000000000000016000A
000000000000004C0022163A000000003A00043AF03AF03AF03AF6073A08043A070516220A
0000000000000016000A
000000000000004C0022163A000000003A00023AF03AF03AF03AF6073A08063A070516220A
0000000000000016000A
000000000000004C0022163A000000003A00013AF03AF03AF03AF6093A08123A070516220A
So I have tried sed:
sed '/0000000000000016000A/d' TL000110.IP.OUT > new.OUT
and I get a zero byte new.OUT. I have tried this identical sed command on a simple text file where I put '00123' strewn throughout and it worked fine.
I tried awk:
awk '{gsub("0000000000000016000A","",$0)}' TL000110.IP.OUT > new.OUT
and I get this message:
awk: line 0 (NR=0): line too long: limit 20000
I tried using tr, but I could only ever get it to work on a character by character basis, so when I asked for it to delete '0000000000000016000A' it also removed all instances of the numbers 0,1,6 and the letter A.
Can anyone here think of a way to remove these errant entries from this file that has long lines?
Thanks for the help!