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

Re: Simple line regex again

by sulfericacid (Deacon)
on Jun 17, 2006 at 02:46 UTC ( #555933=note: print w/replies, xml ) Need Help??


in reply to Simple line regex again

I'll take a stab at this. I did test this and it appears to work flawlessly.
open(LOG, "source2.txt") or die "Error: $!"; my @lines = <LOG>; close(LOG); foreach my $line (@lines) { $line =~ m/(.+)\s+(\d+),\s+(\d+)\s+(\(Birthday\) .+)/; print "$1 $2 $3 $4\n"; open(OUT, ">> $1/$2.txt") or die "Error"; print OUT "\n$3 $4"; } print "Done";


"Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

sulfericacid

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://555933]
help
Chatterbox?
[chacham]: there's a regexp function. if that can be used ina check() constraint...
[LanX]: Thanks, but no check constraints in MySQL :/
LanX 1 ..2 ..3 ..4 .. is erix missing ;-)
LanX is Discipulus reciting "Springtime for Hitler" ?
[choroba]: erix could tell you how to do it in Postgres
[LanX]: NOOOOOOOOOOOOOOO not again
[chacham]: wow, mysql really is as bad as i thougt
[choroba]: completion?
[LanX]: That's what he usually does when MySQL is mentioned ;-)

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2017-03-30 15:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (360 votes). Check out past polls.