Hi Everyone,
I have 1.txt
here
a
b
c' funny"yes";
d
e
The finally output is:
here
a
b
c
d
e' funny"yes";
is any simple way using awk? or others? thanks
---------- Post updated at 06:40 AM ---------- Previous update was at 05:31 AM ----------
i can do the following to remove ' funny"yes";
awk '{sub(/\x27 funny"yes";/,"");print}' 1.txt > 2.txt
How to add ' funny"yes"; to the last line of 2.txt?
Thanks
---------- Post updated at 06:53 AM ---------- Previous update was at 06:40 AM ----------
I know le
$varA=`wc -l 2.txt | awk '{print $1}'`;
awk '{if(NR==$varA){print $0"\x27 funny"yes";"}else{print}}' 2.txt > 3.txt
Hope anyone can give a simple method, instead of remove the string, and add the string.
Thanks