unix - Outputting specific lines based on date and time -


i'm noob @ linux , i'm trying figure out way automate data mining process work since there many values need sort through. have log file in following format:

yyyy-mm-dd hh:mm:ss sensor0 temperature (equation 1) <value0> celsius sensor1 temperature (equation 1) <value1> celsius sensor2 temperature (equation 1) <value2> celsius sensor3 temperature (equation 1) <value3> celsius 

the program spits out these values in format every 5 seconds. want find way process log file , log file has 4 sensor values need based on date , time.

currently, able process file following format filtering phrases out using sed.

yyyy-mm-dd hh:mm:ss  <value0> <value1> <value2> <value3> 

how output 4 values searching specific date , time? have separate log file has time stamps of corner cycles ran, using reference in search of temperature values. format of file is:

yyyy-mm-dd hh:mm:ss yyyy-mm-dd hh:mm:ss 

in final processed output, want contents display following using corner specified time stamps:

date, time, sensor0, sensor1, sensor2, sensor3 yyyy-mm-dd, hh:mm:ss, <value0>, <value1>, <value2>, <value3> 

if exemple want event @ 00:00:00 july 2013:

egrep "2013-07-.. 00:00:00" -a 4 /var/log/temp.log 

that looks lines matching "2013-07-.. 00:00:00", in file /var/log/temp.log, , include next 4 lines (-a 4) in output


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -