hi,
i have file which is having large sql query
eg :
i am executing this sql file but now i want to add ; after query on same line
i.e. i should look like
any idea how to achieve it ?
hi,
i have file which is having large sql query
eg :
i am executing this sql file but now i want to add ; after query on same line
i.e. i should look like
any idea how to achieve it ?
I am really not sure what you are asking. Could you provide a bit more detail, such as a few lines from the current file (or mock ups), and what you want them to look like ?
just wanted to add ; at end of last line !
is it possible via shell script?
Yes:
sed '$s $ ; ' infile > _tmp_ && mv _tmp_ infile
Some sed implementations support in-place editing with the -i switch:
sed -i '$s $ ; ' infile
And, of course, you can use Perl:
perl -i.orig -pe's/$/;/ if eof' infile
ohk good...does it replaces EOF with ; ?
does it means EOF does not exists in updated file ...then i cant read it right ?
Just run the commands and check the file content.
echo "select * from tab" |awk '{print $0";"}'