I am using Linux, I have a template.in file as follows:
xxxxFileNamexxxx
xxxxxxxxxFileName
I want to generate a hundred of files with the filenames and content as follows:
For R1.in
xxxx1xxxx
xxxxxxxxx1
For R2.in
xxxx2xxxx
xxxxxxxxx2
For R100.in
xxxx100xxxx
xxxxxxxxx100
I tried to use the following creatfile.csh script, but did not work. Would experts helps me out? Thanks.
set fnam=1:100
foreach fname
do cp template.in "R$fname.in"
sed FileName fname
done