Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Place semi-colon at the end of the last line

Status
Not open for further replies.

Tdlearner

Technical User
Jun 17, 2004
13
US
How to place a semi-colon at the end of the last line for
*.sql files in perl ?



thanks,
 
How are you using the *.sql files?

Mike

When working on any project the value of other people is exactly that - they are other people, with views that don't necessarily match yours. This mismatch, between their views and the view you've been contentedly assuming is right, is where that value lies.
 
I have bunch of sql files , all have select statements but
semicolon missing at the end of the last lines.

I have written the following sed script to add a semi colon at the end .


file=$1
sed '$d' $file > ${file}.new
sed -n '$p' $file | sed 's/$/ ;/g' >> ${file}.new
mv ${file}.new $file


I was just wondering perl should have more elegant solution.

thanks,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top