Is there a way to append both at header and footer of a file


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Old 02-28-2013
Is there a way to append both at header and footer of a file

currently I've a file

Code:
Insert into CD_CARD_TYPE
   (CODE, DESCRIPTION, LAST_UPDATE_BY, LAST_UPDATE_DATE)
 Values
   ('024', '024', 2, sysdate);
Insert into CD_CARD_TYPE
   (CODE, DESCRIPTION, LAST_UPDATE_BY, LAST_UPDATE_DATE)
 Values
   ('032', '032', 2, sysdate);
........

is it possible to add the following such that output will become as follow:

Code:
prompt loading CD_CARD_TYPE
Insert into CD_CARD_TYPE
   (CODE, DESCRIPTION, LAST_UPDATE_BY, LAST_UPDATE_DATE)
 Values
   ('024', '024', 2, sysdate);
Insert into CD_CARD_TYPE
   (CODE, DESCRIPTION, LAST_UPDATE_BY, LAST_UPDATE_DATE)
 Values
   ('032', '032', 2, sysdate);
........
prompt done loading

understand that we can append anything to the footer of a file by doing the following

echo "prompt done loading" > filename.txt but how about appending the header?

thanks a lot!
# 3  
Old 02-28-2013
Quote:
Originally Posted by jediwannabe
. . .
understand that we can append anything to the footer of a file by doing the following

echo "prompt done loading" > filename.txt but how about appending the header?

thanks a lot!
If you do that, your filename.txt will be gone. Use >> for appending.
Put header in a headerfile and then cat headerfile filename.txt
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Split large xml into mutiple files and with header and footer in file karthik Shell Programming and Scripting 36 20 Hours Ago 01:33 AM
Eliminate Header and footer from EBCDIC file abhilashnair UNIX for Dummies Questions & Answers 4 12-18-2014 05:48 AM
Strip header and footer samrat dutta Shell Programming and Scripting 5 06-17-2013 02:08 PM
File Row Line Count without Header Footer gagan8877 UNIX for Dummies Questions & Answers 7 05-02-2013 02:29 PM
Removing header or footer from file sridhardwh Shell Programming and Scripting 5 06-04-2012 06:43 AM
Add header and footer with record count in footer itsranjan Shell Programming and Scripting 1 03-25-2012 12:45 AM
Header and Footer... suresh_target Shell Programming and Scripting 1 02-15-2012 04:44 AM
sort a report file having header and footer suryanarayana Shell Programming and Scripting 4 11-25-2011 10:48 PM
Ignore Header and Footer and Sort the data in fixed width file sasikari Shell Programming and Scripting 5 07-14-2011 12:42 PM
Help with the Header and Footer check Sunny_teotia UNIX for Dummies Questions & Answers 5 06-06-2011 12:14 AM
Append Spaces At end of each line Leaving Header and Footer deepam Shell Programming and Scripting 1 10-21-2008 05:08 AM
Split large file and add header and footer to each small files ashish4422 Shell Programming and Scripting 7 07-07-2008 03:13 PM
Split large file and add header and footer to each file ashish4422 Shell Programming and Scripting 1 04-15-2008 07:12 AM
Total of lines w/out header and footer incude for a file gzs553 Shell Programming and Scripting 1 11-16-2006 07:42 PM
Need to Chop Header and Footer record from input file coolbudy Shell Programming and Scripting 4 08-09-2005 01:26 PM