Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: counting string in a text file

by PeterPeiGuo (Hermit)
on Jan 13, 2011 at 04:49 UTC ( [id://882029]=note: print w/replies, xml ) Need Help??


in reply to counting string in a text file

You don't need to count. All you need is to find out the boundaries - where color changes. Loop through the file and store boundaries in, for example, a hash. In that hash, use line number as key, and the color as value. This way your code does not have dependency on the number of colors and it is more extensible.

Peter (Guo) Pei

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-24 23:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found