I have a file called part1.pdb...contents are:
ATOM 1 N SER 1 -10.295 -8.909 10.913 1.00 0.00
ATOM 2 H1 SER 1 -10.230 -8.214 10.183 1.00 0.00
ATOM 3 H2 SER 1 -9.558 -8.745 11.584 1.00 0.00
ATOM 4 H3 SER 1 -11.255 -8.966 11.222 1.00 0.00
Now there are several files with name File9_60.pdb, File8_240.pdb etc...
I have to copy content of part1.pdb into each file. i wote a code in perl but this doesnot work...can some1 help..??
#!/usr/bin/perl -w
use strict;
my @filenames = qw(part1.pdb);
for my $filename (@filenames) {
open(my $fr, '<', $filename) or next;
open(my $fw, '>>', grep {/File\d+_\d+/} glob "File*_*.pdb") or next;
local($/) = undef;
my $content = <$fr>;
print $fw $content;
close $fr;
close $fw;
}