Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^5: Using grep to pick out Specific lines in a text file

by hdb (Monsignor)
on Apr 11, 2013 at 20:40 UTC ( [id://1028231]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Using grep to pick out Specific lines in a text file
in thread Using grep to pick out Specific lines in a text file

That is even easier. Just one regex.

use strict; use warnings; use lib "/Library/Perl/5.10.0/"; use autodie; open FILE, "<", "data/04102013_loginlogs.txt" or die "Cannot open inpu +t file.\n"; open OUT, ">>", "output.txt" or die "Cannot open output file.\n"; while( my $line=<FILE> ) { print OUT $line if $line =~ /unknown type\(0x134e\)\s+30\.6511\s+\(V +6\.5\.1 FP1\)/; } close OUT; close FILE;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-04-23 10:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found