Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Parsing a data file to find the highest value.

by FunkyMonk (Chancellor)
on Nov 30, 2007 at 18:55 UTC ( [id://654167]=note: print w/replies, xml ) Need Help??


in reply to Parsing a data file to find the highest value.

As moritz has said, without seeing the format of the input file it's impossible to give a definitive answer, but the following may help you get started

update: Changed the regex to match the data provided by the OP.

my $high_id = 0; open my $ID_FILE, "<", "path/to/file" or die $!; while ( <$ID_FILE> ) { my ( $id ) = m/:(\d+):/; # extract first number from line $high_id = $id if $id > $high_id; } print "highest id found = $high_id\n";

Replies are listed 'Best First'.
Re^2: Parsing a data file to find the highest value.
by misconfiguration (Sexton) on Nov 30, 2007 at 19:06 UTC
    Sorry for the lack of information guys, I'll show you the basic syntax of our printer config file.

    M08_amvpss09_MEDIP :279:lp -damvpss09 >amvpss09.trace 2>&1

    The number :279 is the identifier we need to locate and add by one.

    There are over 700 unique numbers in no particular order, Are you guessing that this will need to be sorted by columns?

Log In?
Username:
Password:

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

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

    No recent polls found