Perl's Command Switches (perlrun) Can be a big help.
C:\Users\Bill\forums\monks>type aria.dat ATOM 9 H5T THY C 1 107.274 35.359 -9.821 0.00 0.00 N1 H ATOM 10 O5' THY C 1 107.686 36.230 -9.553 1.00 0.00 N1 O ATOM 11 C5' THY C 1 108.813 35.973 -8.710 1.00 0.00 N1 C ATOM 12 H5' THY C 1 109.513 35.493 -9.239 0.00 0.00 N1 H ATOM 13 H5'' THY C 1 108.495 35.550 -7.861 0.00 0.00 N1 H ATOM 14 N1 THY C 1 107.956 38.157 -5.232 1.00 0.00 N1 N ATOM 15 C6 THY C 1 107.862 39.006 -4.149 1.00 0.00 N1 C ATOM 16 H6 THY C 1 108.479 39.755 -3.910 0.00 0.00 N1 H ATOM 17 C2 THY C 1 107.024 37.166 -5.449 1.00 0.00 N1 C ATOM 18 O2 THY C 1 107.071 36.398 -6.397 1.00 0.00 N1 O ATOM 19 N3 THY C 1 106.027 37.104 -4.506 1.00 0.00 N1 N C:\Users\Bill\forums\monks>type aria.pl #!perl -pibak use feature 'state'; state $num = 0; $num++; s/^ATOM\s\d+/ATOM $num/; C:\Users\Bill\forums\monks>perl aria.pl aria.dat C:\Users\Bill\forums\monks>type aria.dat ATOM 1 H5T THY C 1 107.274 35.359 -9.821 0.00 0.00 N1 H ATOM 2 O5' THY C 1 107.686 36.230 -9.553 1.00 0.00 N1 O ATOM 3 C5' THY C 1 108.813 35.973 -8.710 1.00 0.00 N1 C ATOM 4 H5' THY C 1 109.513 35.493 -9.239 0.00 0.00 N1 H ATOM 5 H5'' THY C 1 108.495 35.550 -7.861 0.00 0.00 N1 H ATOM 6 N1 THY C 1 107.956 38.157 -5.232 1.00 0.00 N1 N ATOM 7 C6 THY C 1 107.862 39.006 -4.149 1.00 0.00 N1 C ATOM 8 H6 THY C 1 108.479 39.755 -3.910 0.00 0.00 N1 H ATOM 9 C2 THY C 1 107.024 37.166 -5.449 1.00 0.00 N1 C ATOM 10 O2 THY C 1 107.071 36.398 -6.397 1.00 0.00 N1 O ATOM 11 N3 THY C 1 106.027 37.104 -4.506 1.00 0.00 N1 N C:\Users\Bill\forums\monks>type aria.datbak ATOM 9 H5T THY C 1 107.274 35.359 -9.821 0.00 0.00 N1 H ATOM 10 O5' THY C 1 107.686 36.230 -9.553 1.00 0.00 N1 O ATOM 11 C5' THY C 1 108.813 35.973 -8.710 1.00 0.00 N1 C ATOM 12 H5' THY C 1 109.513 35.493 -9.239 0.00 0.00 N1 H ATOM 13 H5'' THY C 1 108.495 35.550 -7.861 0.00 0.00 N1 H ATOM 14 N1 THY C 1 107.956 38.157 -5.232 1.00 0.00 N1 N ATOM 15 C6 THY C 1 107.862 39.006 -4.149 1.00 0.00 N1 C ATOM 16 H6 THY C 1 108.479 39.755 -3.910 0.00 0.00 N1 H ATOM 17 C2 THY C 1 107.024 37.166 -5.449 1.00 0.00 N1 C ATOM 18 O2 THY C 1 107.071 36.398 -6.397 1.00 0.00 N1 O ATOM 19 N3 THY C 1 106.027 37.104 -4.506 1.00 0.00 N1 N
Bill

In reply to Re: renumber entries in column? by BillKSmith
in thread renumber entries in column? by aria

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.