Hi,
i need to change a file with perl having contents below, but it will not do any action if change is being already made.
file.txt
AAAAAA
BBBBBB
CCCCCC
output.txt (that required)
AAAAAA
#BBBBB
DDDDDD
CCCCCC
Thanks,
Hi,
i need to change a file with perl having contents below, but it will not do any action if change is being already made.
file.txt
AAAAAA
BBBBBB
CCCCCC
output.txt (that required)
AAAAAA
#BBBBB
DDDDDD
CCCCCC
Thanks,
sed is easier...
sed 's/^BBBB/#&/' file > newfile
Hi jim,
its so nice you see my post answer, but lets see there are two points, lets suppose i want to comment a particular line number with "#" and wants to add one line text on particular line number, for example i want to comment 45th line and wants to add another line after 90th line and if it is already done so it wont do anything how can i put this.
Thanks, pls advice.
bash