#!/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 = <XF>){ #reads file, takes out erroneous da +ta, if($line = m/TIMESTEP/){ #saves each chunk of 2703 line to $line = ""; #one array slot in superchunk @file = scalar(@trans); @trans[1] = @superchunk;} else if($line = m/ATOM/){ @file = $line;} } $num / $tnum = $div; for($i=1;$i<=$tnum;++$i){ open (OU, "> $lab_$i.pdb") or die "File would not open!!";); print OU (@superchunk[$i*$div]); close OU } #prints every 20th 2703 line ch +unk to #file, different file for each +chunk # close XF
this is my current script it is supposed to go through a file that is near 50 megs of text or better put is 1000 blocks of 2703 lines of coords XYZ label and number every 20th block needs to be removed and put in its own file so that it can be opened in a program that would render the coords... i have any irky feeling that this prog wont do what it should and i figured i would ask instead of beating my silicon graphics workstation with a baseball bat :) kidding if you see any problems with my method, style or just anything plz help me out :) thanx

In reply to Breaking up large database by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.