Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

About text file parsing

by dideod.yang (Sexton)
on Aug 28, 2018 at 23:15 UTC ( #1221282=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    ###### test.txt########
    sample AA
    ...
    good boy
    good yyy
    bad aaa
    
  2. or download this
    open(FILE,"test.txt");
    while(<FILE>){
    ...
     if(/^good\s+(\S+)/){push @good,$1}
    }
    close(FILE);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1221282]
Approved by marto
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2020-12-02 13:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (41 votes). Check out past polls.

    Notices?