I want to align the selected portion of a text file at 9 bytes each column.
For example suppose my text file looks like below.
00 2f c6 b8 29 fd 02 37 11 00 9f 74 34 0b 60 72 38 20 00 9e 61 33 8e ab 8a c0 09
00 fa f0 66 6d 0c 44 d6 24 00 a1 11 9d a2 13 a5 b3 83
I want the resulting file to be like
00 2f c6 b8 29 fd 02 37 11
00 9f 74 34 0b 60 72 38 20
00 9e 61 33 8e ab 8a c0 09
00 fa f0 66 6d 0c 44 d6 24
00 a1 11 9d a2 13 a5 b3 83
What is the easiest way to do this? Is it possible to do it in bash
using sed
or awk
maybe?
Or a better way to frame the question will be I have formatted my input sequence as seen below.
00 88 ec 40 bf 94 1d 63
f4 00 04 1c 4e 06 d0 2c
2e f9 00 90 03 51 d5 71
cc 86 79 00 24 6b 22 30
b6 66 0f 5f 00 c1 cd a5
c8 45 b9 88 85 00 c0 de
ae 47 d9 91 f9 d3 00 5b
That is 8 bytes each line.If you notice carefully in line 1 first byte is 00
.in line 2 the second byte is 00
and in line 3 the third byte is 00
.I want the align the whole file so that the all the lines begin with a 00
.
CTRL+K
or click on the icon that looks like a{ }
– SiegeX Jan 25 '12 at 22:34