Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: matching datetimestamps and concatenating data where timestamps match from multiple large datafiles

by Cosmic37 (Novice)
on Sep 22, 2013 at 17:21 UTC ( #1055195=note: print w/ replies, xml ) Need Help??


in reply to Re: matching datetimestamps and concatenating data where timestamps match from multiple large datafiles
in thread matching datetimestamps and concatenating data where timestamps match from multiple large datafiles

I'm imagining :-D that each file opened has a pointer or equivalent indicating which line we are at. Then if we make a match on the first line of fileA the "while ( $ts_B = <$FILEB> )" statement is not scanning from the beginning of FILEB but from where it previously left off when we are seeking a match for the second line of FILEA. Is this correct? This is obviously important for efficiency and speed as I don't want to be starting all over and scanning through the whole file for each timestamp.


Comment on Re^2: matching datetimestamps and concatenating data where timestamps match from multiple large datafiles
Re^3: matching datetimestamps and concatenating data where timestamps match from multiple large datafiles
by CountZero (Bishop) on Sep 23, 2013 at 06:34 UTC
    Indeed, each filehandle is independent of all others and will keep its own reference to where it was in the file it is connected to. So it has no need to rescan from the very beginning of the file to get the next line.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2014-09-18 20:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (124 votes), past polls