TMTOWTDI. Applying the substitution, s/^[^ ]*\K {5}//, to each line, achieves the realignment you show.

$ cat pm_1207104_data.txt 18450 0600060009 25 0 768188519 768188519 + 0030020124 000 000 10 77019 73587 25 0 73165 7307 +40506 0160100051 029 000 74049 25 0 73950 + 1040030047 030 000 14048 14048 25 0 11833 1183 +3 022 000 18450 0600060027 25 0 709948778 709948778 + 0010030064 000 000 10 73330 25 0 0050312875 7702 +0 000 000 18450 0600040020 25 0 703820853 703820853 + 0030020125 000 000 10
$ perl -pe 's/^[^ ]*\K {5}//' pm_1207104_data.txt 18450 0600060009 25 0 768188519 768188519 + 0030020124 000 000 10 77019 73587 25 0 73165 730740506 + 0160100051 029 000 74049 25 0 73950 + 1040030047 030 000 14048 14048 25 0 11833 11833 + 022 000 18450 0600060027 25 0 709948778 709948778 + 0010030064 000 000 10 73330 25 0 0050312875 77020 + 000 000 18450 0600040020 25 0 703820853 703820853 + 0030020125 000 000 10

— Ken


In reply to Re: Reformat file with empty spaces by kcott
in thread Reformat file with empty spaces 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.