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



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Append to end of each line of file without a temp file. rorey_breaker Shell Programming and Scripting 4 04-03-2008 10:11 AM
search for the contents in many file and print that file using shell script cdfd123 Shell Programming and Scripting 3 10-07-2007 10:17 PM
Creating file contents using contents of another file ReV Shell Programming and Scripting 21 02-24-2006 10:25 AM
Reading specific contents from a file and appending it to another file dnicky Shell Programming and Scripting 5 10-04-2005 05:45 AM
Append a field to the end of each line of a file based on searching another file. ultimate Shell Programming and Scripting 2 03-29-2005 10:21 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-27-2006
gopskrish gopskrish is offline
Registered User
  
 

Join Date: Jun 2005
Posts: 26
append file name contents to a target file

Hi ,

I want to append the contents of many files (not knowing exactly how many files, i will get) in to one target file on a day today basis.
The file names are similar except last value (which is sequence number)

eg) file1_20061026_1
file1_20061026_2 etc.,

How can i read all the files one by one and append it to the target file.
I am very new to unix and it would be great if i get help from Unix Gurus.

Thanks in advance,
gops
  #2 (permalink)  
Old 10-27-2006
pressy's Avatar
pressy pressy is offline Forum Staff  
solaris cultist
  
 

Join Date: Aug 2003
Location: Vienna / Austria (Europe) [EARTH]
Posts: 726
could be something like this:

Code:
root@mp-wst01 # echo "1" > file1_20_1
root@mp-wst01 # echo "2" > file1_20_2
root@mp-wst01 # for x in file1_20_* ; do cat $x >> target; done
root@mp-wst01 # more target
1
2
root@mp-wst01 #
regards pressy
  #3 (permalink)  
Old 10-27-2006
gopskrish gopskrish is offline
Registered User
  
 

Join Date: Jun 2005
Posts: 26
Thanks Pressy.

It worked.

Is it possible to assign the target file (in our example target) to some parameter file so that etl jobs can read the file name.

eg)
testparams (Parameter file name)
fromdate=
todate=
file_name=(here our target file name should appear)

Thanks in advance.
cheers,
gops
Sponsored Links
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 03:30 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
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