Found it:

foreach my $line (@array) { my @column = split( /\s+/, $line ); print $column[0], " ", $column[1], " ", $column[7],"\n"; my $columnID = $column[0]; foreach ( my $columnID ) { while ( $columnID =~ /(^FBgn\d+)/ ) { my $ID = $1; print $ID, "\n"; } } }

Which yields:

[kdfadm@serv01 ~]$ /usr/bin/perl SplitTest root 10053 sudo kdfadm 10057 -bash root 24073 sudo kdfadm 24077 -bash kdfadm 28868 scp kdfadm 28869 /usr/bin/ssh kdfadm 29005 /usr/bin/perl kdfadm 29006 sh kdfadm 29007 ps kdfadm 29008 grep root 111587 sudo kdfadm 111592 -bash kdfadm 121521 /bin/sh kdfadm 121527 /opt/kdf/home/java8/bin/java kdfadm 121562 /opt/kdf/home/jdk1.8.0_162/jre/bin/java kdfadm 121563 /opt/kdf/home/jdk1.8.0_162/jre/bin/java kdfadm 121572 /opt/kdf/home/jdk1.8.0_162/jre/bin/java kdfadm 121576 /opt/kdf/home/jdk1.8.0_162/jre/bin/java kdfadm 121597 /opt/kdf/home/jdk1.8.0_162/jre/bin/java kdfadm 121600 /opt/kdf/home/jdk1.8.0_162/jre/bin/java kdfadm 121615 /opt/kdf/home/jdk1.8.0_162/jre/bin/java kdfadm 121622 /opt/kdf/home/jdk1.8.0_162/jre/bin/java

Thanks to anyone who had a look.


In reply to Re: How to awk a grep result in-script by ShipWreck
in thread How to awk a grep result in-script by ShipWreck

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.