Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Add a column to a file

$
0
0
Hi,
I have this data file that contains:
Code:

1        A
2        B
3        C
4        D
5        E
6        F
7        G
8        H
9        I

I want the results to be:
Code:

1        A        A
2        B        A
3        C        A
4        D        A
5        E        A
6        F        A
7        G        A
8        H        A
9        I        A
1        A        B
2        B        B
3        C        B
4        D        B
5        E        B
6        F        B
7        G        B
8        H        B
9        I        B
1        A        C
2        B        C
3        C        C
4        D        C
5        E        C
6        F        C
7        G        C
8        H        C
9        I        C
and on and on to line 9....

Many thanks!
Moderator's Comments:
Without CODE tags, readers can't tell that your data uses tabs instead of spaces as field delimiters.

Please format your posts as required by forum rules and stop depending on forum moderators to clean up all of your posts.

Viewing all articles
Browse latest Browse all 16232

Trending Articles