Say I have a csv file with these columns:
An example of the shape of the actual data would be this chart:
Having the data visualized in this way, it's easy for the human eye to make out where any of the 4 cpu intensive activities start and end.
What would be an easy way, using standard unix cmd line tools, ideally not resorting to
octave etc, to "grep" only the 8 lines of the file that denote the onset and end of these 4 activities, based on the "cpu" column?
Obviously this is somewhat fuzzy, and there is noise in the data, but any solution that gives me 8 lines that are somewhere close to onset/end is appreciated.
A short excerpt of the csv file, showing only the first of those 4 bursts of activity:
10:44:21.310,0,53567488 10:44:22.310,1.56257,53575680 10:44:23.326,0,53854208 10:44:24.325,34.3761,57405440 10:44:25.325,73.43985,61747200 10:44:26.325,3.1251,69459968 10:44:27.325,0,69459968 10:44:28.325,0,69459968 10:44:29.325,65.6271,74756096 10:44:30.325,53.1267,77783040 ... 10:50:56.450,35.93865,142700544 10:50:57.450,10.93785,142897152 10:50:58.450,1.56255,142897152 10:50:59.450,0,142897152 10:51:00.450,0,142897152 10:51:01.450,0,142897152
Ideally, this would result in the following 2 lines.
However, as there is no cpu activity for a couple of seconds between
10:44:28.325, I don't expect the answer to be that smart and do something akin to 'smoothing' the data. So if a csv snippet like the above would e.g. yield the following 4 lines, that would suffice.
10:44:24.325,34.3761,57405440 10:44:26.325,3.1251,69459968 10:44:29.325,65.6271,74756096 10:50:58.450,1.56255,142897152