Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Selecting a particular record from groups of records

by jethro (Monsignor)
on Sep 20, 2012 at 13:52 UTC ( #994666=note: print w/replies, xml ) Need Help??


in reply to Selecting a particular record from groups of records

Is your data sorted for date/time, i.e. are all records with the same date/time together? You implied it but I want to make sure I understand you correctly.

In that case you can just write a loop, reading each record and checking for two things: If the date/time is the same as the previous record then if the QC flags are lower than the QC flags of a temporary record, replace the temporary record with this record. If the date/time is new, then print the temporary record (which holds the lowest record of the previous date/time) and replace the temporary record with this record. That's all

If your data is not sorted for date/time, then you need to store the smallest record for each date/time in a hash and output those records after you read the whole file. A problem might be that you need to have as many records as you have different date/times in memory, but it doesn't sound as if that is a problem for your case

PS: A flag is a data item that is either on or off. So technically there is no smallest value for flags. You can easily confuse programmers with misnomers like this

  • Comment on Re: Selecting a particular record from groups of records

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://994666]
help
Chatterbox?
[james28909]: and that is also anothe rpoint i made, i think it has to do with perception of the world around you. most people think of evolution on a human scale. why could life evolve on this planet? because this planet evolved in this solar system. and so on.
[holli]: here's something for you to watch, James. I think you will like it
[erix]: for the record: I have not downvoted anyone on that subthread that was my fault
[james28909]: there are all kinds of things that had to happen to let life come to be. but at the same time, life may not be the end goal IF there is any kind of end goal lol
[james28909]: well who is the person who gets to decide which behaviour is worthy of a downvote? a person with their own beliefs? xD
[erix]: teleology -- I've never understood why that was thunk up
[erix]: ( and when teleology was brought up, during my biology-study., I couldn't get an answer either )
[1nickt]: FTR I agree with you about "design." Just not sure about the trajectory of evolution. THere are a lot of dead-ends in the evolutionary paths. I suspect homo sapiens is just one of them.
[james28909]: thanks for the vid holli, i do like it. thanks for sharing :)

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (15)
As of 2017-12-15 14:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (433 votes). Check out past polls.

    Notices?