Reputation: 929
I have a file which contains something like that:
0x0a ,0x63 ,0x31 ,0x38 ,30
0x6b ,0x5f ,0x6c ,0x69 ,6d
0x0a ,0x63 ,0x31 ,0x38 ,30
0x6b ,0x5f ,0x6c ,0x69 ,6d
0x69 ,0x74 ,0a
What I want to do is to use sed
(or a different command) for appending a 0x
in front of the last hex number of each line and also a comma ,
at the end of each line. That is, for the above code snippet, I want that:
0x0a ,0x63 ,0x31 ,0x38 ,0x30,
0x6b ,0x5f ,0x6c ,0x69 ,0x6d,
0x0a ,0x63 ,0x31 ,0x38 ,0x30,
0x6b ,0x5f ,0x6c ,0x69 ,0x6d,
0x69 ,0x74 ,0x0a,
I want that replacement to start from the beginning of the file until an empty line is detected.
Thanks in advance for any help.
Upvotes: 2
Views: 266