fedora
February 12, 2008, 4:31pm
1
I have two files, each of them has 12 lines, fileA has 3 columns, fileB has 1 column, like the following
FileA
a 1
b 2
c 3
..blabla
FileB
A
B
C
..blabla
Now I am trying to put the content of fileB as column 3 of fileA, e.g.
a 1 A
b 2 B
c 3 C
...blahblah
I figure there should be a simple unix command can be used to do this, am I right?
quite right, paste should do it.
paste FileA FileB will give you the desired output.
paste FileB FileA will reverse it.
fedora
February 12, 2008, 4:47pm
3
wow, this is great!
I am reading manpage of paste, but not quite understand what does "-" do,
why
ls| paste -d" " -
lists a dir in one column?
maestrorage:
quite right, paste should do it.
paste FileA FileB will give you the desired output.
paste FileB FileA will reverse it.
I responded with an answer but I misunderstood the question.
I'm taking back my answer. I did not see any option to delete my message
So edited my message