Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: text sorting question

by plaid (Chaplain)
on Aug 03, 2000 at 00:37 UTC ( #25841=note: print w/replies, xml ) Need Help??


in reply to text sorting question, kinda

The first way that comes to mind offhand would be to do something like
my @top_lines; my @other_lines; while(<FILE>) { # whatever regex to strip out lines (/blahblah$/) ? push @top_lines, $_ : push @other_lines, $_; } print OUTFILE @top_lines; print OUTFILE @other_lines;
This would work well provided that the file doesn't get too big, as the entire thing is going to have to be kept in memory. But, if it's about 200k as you say, that should work fine.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2022-01-23 10:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (63 votes). Check out past polls.

    Notices?