Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Print the output results of matching line horizontally

by NetWallah (Canon)
on Jan 14, 2018 at 19:03 UTC ( [id://1207224]=note: print w/replies, xml ) Need Help??


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:  <%-{-{-{-<

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1207224]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-19 19:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found