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 read record by record from a file in unix raoscb UNIX for Dummies Questions & Answers 1 05-16-2008 07:30 AM
Script to search a bad record in a file then put the record in the bad file shilendrajadon Shell Programming and Scripting 2 12-28-2007 10:02 AM
Script to search a bad record in a file then put the record in the bad file shilendrajadon UNIX for Advanced & Expert Users 1 12-28-2007 10:00 AM
merge two files in one file nvkuriseti Shell Programming and Scripting 3 08-27-2007 07:06 AM
splitting a record and adding a record to a file rsolap Shell Programming and Scripting 1 08-13-2007 02:58 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 08-19-2008
vkr vkr is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 9
MERGE 13 files and add the file name at the end of each record

Hi Gurus,
I have 13 comma(,) seperated files that i have to merge and create a single file which has file name attached at th end of each record in the out put file. Can any one please help me with writing a unix script with this issue?

test1.dat
BIG ID,Local ID,Bond Description,Liquidity,Maturity,Mat Sect,Price,Accr Int,Outs-Loc ,MVal-Loc,MVal-USD,MVal-EUR,Mac Dur,Mod Dur,Yield,Convexity,Coupon,Issue Date,Freq,ISIN
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 3',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,AT0000384938
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 3',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,PT0000384939
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 3',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,PT0000384939
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 3',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,PT0000384939

test2.dat
BIG ID,Local ID,Bond Description,Liquidity,Maturity,Mat Sect,Price,Accr Int,Outs-Loc ,MVal-Loc,MVal-USD,MVal-EUR,Mac Dur,Mod Dur,Yield,Convexity,Coupon,Issue Date,Freq,ISIN
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 3',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,AT0000384938
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 3',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,PT0000384939
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 3',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,PT0000384939
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 3',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,PT0000384939

test3.dat
BIG ID,Local ID,Bond Description,Liquidity,Maturity,Mat Sect,Price,Accr Int,Outs-Loc ,MVal-Loc,MVal-USD,MVal-EUR,Mac Dur,Mod Dur,Yield,Convexity,Coupon,Issue Date,Freq,ISIN
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 3',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,AT0000384938
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 3',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,PT0000384939
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 3',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,PT0000384939
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 3',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,PT0000384939
so on upto thirteen files

my output neeeds to be
outputfile.dat
BIG ID,Local ID,Bond Description,Liquidity,Maturity,Mat Sect,Price,Accr Int,Outs-Loc ,MVal-Loc,MVal-USD,MVal-EUR,Mac Dur,Mod Dur,Yield,Convexity,Coupon,Issue Date,Freq,ISIN,FINENAME
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 3',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,AT0000384938,test1.dat
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 3',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,PT0000384939,test1.dat
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 3',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,PT0000384939,test1.dat
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 3',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,PT0000384939,test1.dat
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 6',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,AT0000384938,test2.dat
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 6',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,PT0000384939,test2.dat
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 6',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,PT0000384939,test2.dat
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 6',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,PT0000384939,test2.dat
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 8',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,AT0000384938,test3.dat
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 8',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,PT0000384939,test3.dat
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 8',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,PT0000384939,test3.dat
AAA0024,BBB0024,sync 5.50% RAGB Jan 2010,Ben,15-Jan-2008,'1 - 8',101.075,2.87,8809.982,9157.532,14524.303,9157.532,1.427,1.363,4.703,3.205,5.5,22-Oct-1999,1,PT0000384939,test3.dat


I appreciate if any one can help me with this issue.
thanks
vkr
 

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 04:24 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