I'm learning the sed loop construct and having difficulty.
The input file consists of a variable number of blank-delimited fields.
Sample input file:
Code:
000001 now is the time
000002 for all good men
000003 to come to the aid
000004 of their country
The desired transformation replaces the 2nd, 3rd, ... nth field
with whatever appears in the first field.
In this example the first field is a line number but it could be
anything (color, city, car model, etc.)
Sample output file:
Code:
000001 000001 000001 000001 000001
000002 000002 000002 000002 000002
000003 000003 000003 000003 000003 000003
000004 000004 000004 000004
Is sed-with-loop a suitable technique?
If so, please show how it is done.
Daniel B. Martin