ok. so here's a data file that I have from a C program that prints 0's for no user activity, 1 for user activity in the last minute, and X's for system standby or reboot etc. See same data file below:
--------------------------
----------
----------
----------
--
- This is the output file from idleCollect2. Data is -
- collected once per minute. Output data is '0' for no -
- user keyboard or mouse activity in the last minute, -
- '1' for activity, and 'X' for system in sleep mode. -
--------------------------
----------
----------
----------
--
Collecting data for 30 days
Program start time = Mon Aug 27 17:41:45 2007
Data collection start time = Mon Aug 27 20:00:00 2007
--------------------------
----------
----------
----------
--
11000000000000100000000000
0000000000
0000000000
000000000X
XXXX : null
XXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXX111011
0010 : Mon Aug 27 22:00:00 2007
00000000000000000000000XXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXX : null
11111111111111111111111111
0001011000
0000000011
0000000111
0000 : Tue Aug 28 00:00:00 2007
011001XXXXXXXXXXXXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXX : null
XXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXX : null
XXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXX : null
XXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXX : null
XXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXX : null
XXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXX : null
XXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXX : null
XXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXX : null
XXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXX : null
XXXXXXXXXXX101000000000011
1111XXXXX1
1111111111
1111111101
1111 : Tue Aug 28 10:00:00 2007
I'm trying to find a way to represent the data in a more meaningful way i.e. be able to graph something to show how often a user is busy, idle, and be able to predict according based on history of user data. So the only way I thought of is to write a program to grab the timestamp for each entry in this text file, count the number of X's 1's and 0's in each log and print that in another file. The output could be something like this:
- timestamp: X's: 25, 1s: 16, 0s: 19
The null timestamp is there because I chose not to print the timestamp for when the pc was rebooted, standby or etc. so no need to timestamp those entries.
The other possible problem in the text file is when the pc reboots, standby or etc, the program auto resumes but I don't want it to print the header above again in the text file. I just want it to simply continue printing in the log i.e 1's 0's and X's for the next hour.
can anyone help as far as implementing the logic to grab the timestamp for each entry in the text file, count and print the number of 1's, 0's and Xs?
If you guys want, I can post some codes use to generate the data file.
Start Free Trial