The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 07-07-2008
penlok penlok is offline
Registered User
  
 

Join Date: Jul 2008
Location: San Jose, CA
Posts: 3
copy column to another file

Hi guys,

I want to use a quick one liner that can copy an entire column, and add it to a new file as another column. I've tried using cat, but that only appends my column to the bottom of the file.

So now, my first file(file1) looks like this:

1995060101 8
1995060102 6
1995060102 10

and so on, down through 2007123124. I want to take the second column, and add it to a new file(file 2), which currently looks like this:

1995060101 4
1995060102 3
1995060102 15

So in the end, I want file 2 to look like this:

1995060101 4 8
1995060102 3 6
1995060102 15 10

I've tried looking around the forums for help, but most of the copy column info seems to be about replacing current columns with others, not so much appending them.

thanks for any help you guys can offer!