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 redirect the output to multiple files without putting on console prashant43 Shell Programming and Scripting 2 08-26-2009 10:53 AM
Putting multiple sed commands on a single line varelg Shell Programming and Scripting 1 07-21-2009 05:02 PM
Consequences of putting large/multiple jobstreams ON ICE... CyberOptiq UNIX and Linux Applications 0 05-20-2009 08:13 PM
Joining files based on multiple keys Sebben UNIX for Dummies Questions & Answers 1 04-20-2009 09:00 AM
rename multiple filename.45267.txt to >> filename.txt jason7 Shell Programming and Scripting 6 01-29-2009 05:37 PM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 4 Weeks Ago
phil_heath phil_heath is offline
Registered User
  
 

Join Date: May 2009
Posts: 57
joining multiple files into one while putting the filename in the file

Hello, I know how to join multiple files using the cat function. I want to do something a little more advanced. Basically I want to put the filename in the first column...

One thing to note is that the file is tab delimited.

e.g.


Code:
file1.txt

joe 1 4 5 6 7 3
manny 2 3 4 5 6 7


Code:
file2.txt

bob 1 5 6 7 4 3
larry 2 4 3 2 1 2

so i want to join both files so it looks like this


Code:
file1 joe 1 4 5 6 7 3
file 1 manny 2 3 4 5 6 7
file 2 bob 1 5 6 7 4 3
file 2 larry 2 4 3 2 1 2



thanks
 

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:55 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