I have an input as follows
Input File Name : a.txt
-- Some Comment
delete from tb.Test WHERE id = 'abxd1';
delete from tb1.Test WHERE id = 'abxd2';
-- Some Comment
delete from tb1.Table1 WHERE id = 'abxd3';
Expected output file : b.txt
-- Some Comment
delete from Test WHERE id = 'abxd1';
delete from Test WHERE id = 'abxd2';
-- Some Comment
delete from Table1 WHERE id = 'abxd2';
The following code will just replace the value "tb.". I am trying to make this as a generic script.
while read line
do
str=$line
echo "${str/tb./}" >>b.txt
done <$1
Thanks for you help