Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.


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  
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  
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
Eliminate Header and footer from EBCDIC file
abhilashnair
Is there any command to eliminate Header and footer from EBCDIC file... UNIX for Dummies Questions & Answers
4
UNIX for Dummies Questions & Answers
Removing header or footer from file
sridhardwh
Hi Every one, what is the coomand to remove header or footer from a file. Please help me by providing command/syntax to remove header/footer from unix. Thanks in advance for all your support.... Shell Programming and Scripting
5
Shell Programming and Scripting
Add header and footer with record count in footer
itsranjan
This is my file(Target.txt) name|age|locaction abc|23|del xyz|24|mum jkl|25|kol The file should be like this 1|03252012 1|name|age|location 2|abc|23|del 2|xyz|24|mum 2|jkl|25|kol 2|kkk|26|hyd 3|4 Column 1 is row indicator for row 1 and 2, column indicator is 1,for data rows...... Shell Programming and Scripting
1
Shell Programming and Scripting
sort a report file having header and footer
suryanarayana
I am having report file with header and footer . The details in between header and footer are separated by a pipe charater. I want to sort the file by considering multiple columns in between header and footer. pls help... Shell Programming and Scripting
4
Shell Programming and Scripting
Append Spaces At end of each line Leaving Header and Footer
deepam
How to append constant No of spaces suppose 52 at end of each line in a file (xyz) excluding first and last line. Please Help me out for the same.... Shell Programming and Scripting
1
Shell Programming and Scripting

Featured Tech Videos