How to append a string to the end of each line ?
I’ve got a SQL script file with no “;” in end of lines. This file has 500k lines.
Googling to find some help I’ve found two ways to solve:
1) using ‘sed’
sed -i ‘s/$/;/’ filename
2) using ‘vi’
:%s/$/;/g
I also found other ways to do same thing using Perl, Java, ….. but sed/vi is more quick and simple.
Advertisement