The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to create concatenate a file in tab format ahjiefreak UNIX for Dummies Questions & Answers 12 12-11-2007 08:22 PM
Reading a file and writing the file name to a param file. thebeginer UNIX for Advanced & Expert Users 1 10-05-2007 05:38 PM
Reading file names from a file and executing the relative file from shell script anushilrai Shell Programming and Scripting 4 03-10-2006 05:25 AM
Concatenate date to file name sierra_aar UNIX for Dummies Questions & Answers 4 02-14-2002 09:42 AM
file Concatenate alisev UNIX for Dummies Questions & Answers 3 01-02-2002 01:53 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-26-2006
Soumya Dash Soumya Dash is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 13
Concatenate a file with another file.

Hi All,
I have a problem in concatenate a file with another file.
The problem is as below:

I have a file with three columns and 7 rows. This is the first file and all separated by tab delimited format.

The second file has 8 colunms and 7 rows. And also separated by tab delimited format.
So now I need the first file with three colunms to come first and than the second file with 8 columns and make a third file of total 11 colunms and 7 rows.

Can any one have any inputs....Its needed in a reporting application.
Thanks in advance...To all masterminds....
  #2 (permalink)  
Old 11-27-2006
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,122
look into 'man paste'
  #3 (permalink)  
Old 11-27-2006
Soumya Dash Soumya Dash is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 13
Quote:
Originally Posted by vgersh99
look into 'man paste'
Hi vgersh,
Thanks for you input but can you give example!!!!
Like taking two files as input and puting the output of the two into a third file.

I have tried the same but not able to do the same....

It will be helpful if you can do that a simple example...

Thanks and Regards,
Soumya
  #4 (permalink)  
Old 11-27-2006
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,957
There have been so many posts describing the usage of paste

> cat a
1 2 3
4 5 6


>cat b
a b c d e
a b c d e

>paste -d" " a b
1 2 3 a b c d e
4 5 6 a b c d e


-d is for delimiter, change accordingly for your case
Bits Awarded / Charged to matrixmadhan for this Post
Date User Comment Amount
06-25-2009 Anonymous Thanks from a Unix_sortof_Newbie! 50,000
  #5 (permalink)  
Old 08-09-2008
thegant thegant is offline
Registered User
  
 

Join Date: Oct 2007
Location: Finland
Posts: 7
Thanks

Thanks...just what i was looking for
  #6 (permalink)  
Old 05-21-2009
sogi sogi is offline
Registered User
  
 

Join Date: May 2009
Posts: 21
How to concatenate two files at a specific column

Hi

I have two files, one is 1.6 GB, I would like to add one extra column of information to the large file at a specific location. After the 3rd column.

For example:

File 1 has two columns more than 1000 rows like this

MM009987 1

File 2 has dozens of columns like this

MM00098 MM00076 3 4 2 4 2 1 3

I would like to add the 2nd column from File 1 to File 2 after column 3

Thank you for any help on this
  #7 (permalink)  
Old 05-21-2009
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,540
this is an old thread.

you said the one of the file is 1.6GB, and file 1 has only more than 1000 rows. So how's it going to look like after the 1000th line of your big file when you have inserted those 1000++ 2nd columns into it?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:32 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0