J
jobs239
I need to parse a text file where each line is timestamped.
Each line has the form "timestamp, value1, value2"
I have to get max value of value1 between two timestamps and the the
avg value of value2 between another two timestamps. What would be an
efficient way to do this in terms of memory and processing time?
What comes to mind now is to read each line and store values in a
vector of objects. Then traverse that vector later to find the starting
timestamp and ending timestamp and process data in between. But it
doesn't sound like the most efficient way given that the files are huge.
Each line has the form "timestamp, value1, value2"
I have to get max value of value1 between two timestamps and the the
avg value of value2 between another two timestamps. What would be an
efficient way to do this in terms of memory and processing time?
What comes to mind now is to read each line and store values in a
vector of objects. Then traverse that vector later to find the starting
timestamp and ending timestamp and process data in between. But it
doesn't sound like the most efficient way given that the files are huge.