#!/usr/bin/perl -w $xf = "~/OUTPUT"; #enter file name location here <- $num = 1000; #enter number of iterations here <- $tnum = 20; #enter number of pdbs necessary <- $lab = "BRO"; #enter label for output <- open (XF, $xf) or die "no $xf exists!!"; while (my $line = ) { #reads file, takes out erroneous data if($line = m/TIMESTEP/) { #saves each chunk of 2703 line to $line = ""; #one array slot in superchunk @file = scalar(@trans); @superchunk = $trans[0]; } #trans has only one #slot in it i want that #slot to go to one slot in super chunk else if($line = m/ATOM/) { @file = $line; } $num / $tnum = $div; } for($i=1;$i<=$tnum;++$i) { @name = ('> ', $lab , '_' , $i , '.pdb'); @name = scalar(@hopname); print "$hopname[0] \n"; open (OU, $hopname[0]) or die "File would not open!!"); #The $lab and $i vars need to be output into the filename #string so that each filename is different yet identify- #-able as part of this process and the .pdb is the file #extention print OU (@superchunk[$i*$div]); close OU } #prints every 20th 2703 line chunk to #file, different file for each chunk close XF