I want to create multiple files at a time using names from a file list.txt, as well as the text in each files.
Suppose I have a list.txt
containing some id
. numbers, now I want to make separate files using that ids as the name (e.g. EOG090W002U_M0.ctl
, EOG090W00C1_M0.ctl
, EOG090W00DC_M0.ct
l). Also, the contents of the files need to be changed accordingly.
Sample list.txt:
EOG090W002U
EOG090W00C1
EOG090W00DC
EOG090W00DE
EOG090W00E5
EOG090W00HR
EOG090W00MH
EOG090W00MS
EOG090W00PB
EOG090W00U4
EOG090W00UK
EOG090W00WM
EOG090W00WR
For example the desired content of EOG090W002U_M0.ctl
, EOG090W00C1_M0.ctl
file will be
seqfile = EOG090W002U_p.phy
treefile = Sametree.txt
outfile = EOG090W002U_M0_mlc
getSE = 0
RateAncestor = 1
Small_Diff = 5e-7
cleandata = 1
fix_blength = 2
method = 0
Or
seqfile = EOG090W00C1_p.phy
treefile = Sametree.txt
outfile = EOG090W00C1_M0_mlc
getSE = 0
RateAncestor = 1
Small_Diff = 5e-7
cleandata = 1
fix_blength = 2
method = 0
Here, seqfile
and outfile
is going to be changed according to the list.txt
but other texts in the file will remain the same.
Thanks
>>
rather than>
? – steeldriver Jan 23 '20 at 17:54seqfile = EOG090W034W _p.phy treefile = Sametree.txt outfile = EOG090W034W _M0_mlc
So, there is a clear space between the variable and the extension. How can I get rid of this problem.
Thanks
– Debajyoti Kabiraj Jan 24 '20 at 04:56