Hello jlope043

if you are refreshing your Perl skill, please note the modern form of opening files using lexical filehandle instead of bareword ones:

open my $fh, '<', $filepath or die "could not open:$!";

Also if you use the low precedence or parens are unneeded.

If I understand your need your $find begins at 18 not 32:

# warning windows doublequote perl -lanE "print $1 if /^.{17}(.*)/" datacolumn.txt HT000000000 123 50 70 80 H0000000000 123 50 70 80 HT000000000 123 50 70 80
Or if you want to use @F faciliy provided by -a Perl switch you can print element using negative indexes (because you have JOHN, DOE JR ie variable lenght fields)
perl -lanE "say join ' ',@F[-5,-4,-3,-2,-1]" datacolumn.txt HT000000000 123 50 70 80 H0000000000 123 50 70 80 HT000000000 123 50 70 80

Finally if you want to refresh your Perl Modern Perl is very worth a read and is free!

HtH

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

In reply to Re: Copy Line After Skipping Columns -- oneliner by Discipulus
in thread Copy Line After Skipping Columns by jlope043

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.