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 > 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
MERGE 13 files and add the file name at the end of each record vkr Shell Programming and Scripting 2 08-19-2008 12:57 PM
merge two files in one file nvkuriseti Shell Programming and Scripting 3 08-27-2007 07:06 AM
total number of files which have "aaa" in files whose names are File*_bbb* sudheshnaiyer UNIX for Dummies Questions & Answers 1 08-16-2007 03:34 PM
how to remove files with only numbers as file names? praveen_indramo Shell Programming and Scripting 6 06-07-2007 10:13 AM
How can I delete files using a file that containt path and names? AlvaroD UNIX for Dummies Questions & Answers 2 09-25-2001 01:51 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 10-01-2008
harshada harshada is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 5
Merge two files whose names are given in other file

Hi,

I have a pointer file ptr.txt.
There may be any number of files mentioned in the ptr.txt file
eg: cat ptr.txt
/home/abc.txt
/home/pqr.txt
/home/xyz.txt


I have to read this pointer file and merge the files given in the pointer file
so that final file say "file_final" will have contents of abc.txt , pqr.txt and xyz.txt one below other.

This i have to do in a shell script.
Can anyone help me on this?

Thanks,
H
  #2 (permalink)  
Old 10-01-2008
hiptoss hiptoss is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 7
Code:
for i in `cat ptr.txt`
do
  cat $i >> file_final
done
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 05:08 PM.


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