I have many files, from file0
to file3100
. I want to add ###
for one line in each file.
The line
Generated by trjconv : PTEG1 t= 8100.00000
should be
###Generated by trjconv : PTEG1 t= 8100.00000
The time (t
) in each file is different. How can I add ###
to each file in once and the time (t
) is still same in each file as before adding?
Here is what I tried:
#!/bin/bash
# loop all inp files in the current dir
for frameFile in frame*.inp; do
sed -i -r -e 's/Generated by trjconv : pteg-1 t=.+/###Generated by trjconv : pteg-1 t=.+/g' ${frameFile}
fi
done