AWK experts - how would I code around this in awk...

Christopher Chan christopher.chan at bradbury.edu.hk
Fri Feb 19 01:08:53 UTC 2010


On Friday, February 19, 2010 02:02 AM, Steve Flynn wrote:
> I have a text file with lines of differing length.
>
> I want  to parse the entire file and make each line (for example) 20 bytes long.
>
> If a record is too short as in the following example: (rec1,2 and 3
> are just so I can refer to them easily - the example file should be
> just the numeric portion).
>
> rec1 123456789012345
> rec2 67890
> rec3 12345678901234567890
>
> ... then I need to append rec2 to rec1.

You just have to make each line 20 bytes long right. There is no need to 
preserve lines that are already 20 bytes long like in the case that rec1 
+ rec2 will not make up 20 bytes and so we chop up rec3 and so on and so 
forth right?




More information about the ubuntu-users mailing list