in reply to Print the output results of matching line horizontally

>perl -ane 'm/Student Name\s+=\s+(\w+)/ and $name=$1; m/Exam Status\s+ +=\s+(\w+)/ and print qq{$name\t$1\n}' results.bat Harry PASSED Mike PASSED Tom PASSED
If you are on Windows, use double quotes instead of single.

                Is a computer language with goto's totally Wirth-less?

Replies are listed 'Best First'.
Re^2: Print the output results of matching line horizontally
by AnomalousMonk (Archbishop) on Jan 14, 2018 at 20:47 UTC
    >perl -ane '...' results.bat Harry PASSED Mike PASSED Tom PASSED

    But my understanding is that sreek3502 wants output something like:

    Harry PASSED Mike PASSED Tom PASSED


    Give a man a fish:  <%-{-{-{-<

      You may be right, and that's more or less what I think to understand, but it is far from clear because the original post lacks proper formatting.

      To the Original poster: please add <code> and </code> tags to both your input data sample and your desired result, so that we can really figure out what you need.

      I examined the raw HTML of the original post.

      It appears that the OP wanted each name on a separate line.

                      Is a computer language with goto's totally Wirth-less?

        I examined the raw HTML of the original post.

        Ah-HA! I should have thought of that.


        Give a man a fish:  <%-{-{-{-<