0

I have one file like this:

aaa
bbbb
c

And another one like this:

1  1241
2  301094209
3  432423

I want this:

1  1241 aaa
2  301094209 bbbb
3  432423 c

so I can plot it with Gnuplot. If you know how to plot it without doing this manipulation I would like to know also, but I want to know how I could do the thing I want to do also :)

3 Answers 3

4
paste -d " " file2 file1 

Output:

1  1241 aaa
2  301094209 bbbb
3  432423 c

-d LIST: reuse characters from LIST instead of TABs

0
3

Perhaps the command paste is what you are looking for?

paste file0 file1

This will print, in sequence, each line of file0, followed by the matching line of file1. The default separetor is a tab, but that can be changed with -d if necessary.

2

try paste. From man page: write lines consisting of the sequentially corresponding lines from each FILE, separated by TABs, to standard output. With no FILE, or when FILE is -, read standard input.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .