I m new to this forum & UNix too.
currently i have a requirement which can fetch data from a logfile between two dates or timestamp.
for example:
1. data from 2012 Jun to 2012 Jul
2. data from 2012 Jun to 2012 Jul 07
3. data from 2012 Jun 16 10:20 to 2012 Jul 03 10:10
Please note that the fetched data shoul contain logs of both the dates including repeating logs.
Could you please help me solve it with awk command?
Currently i am using
Its working fine if there is only single records for the destination date.
But if we have many records like
Then for data between 2012 Jun to 2012 Jul
It is displaying only
whereas i need like:
So please help me to get the expected output.
Thanks in advance!
KD
Last edited by Franklin52; 08-23-2012 at 09:50 AM..
Reason: Please use code tags for data and code samples
@pamu
The sed code contains the same bug as the original awk code ! Both of them stop after the first occurance of the end string.
Correction. The output from the first sed is not posted correctly (there should be one more output record). If the stop string is actually the whole contents of the last record for the month, the sed works. This does not however match the specification.
I can't think of a string processing method to process alphabetic date ranges. They are going to have to be converted to a numeric form and compared as YYYYMMDDHHMMSS or perhaps seconds since the Epoch.
Do you have:
Perl ?
GNU date ?
Hi,
I am new to scripting. I have a log file and need to fetch specific logs and copy to another file.
A copy of the log is like this:
===============================================================
= JOB : server123#jobs1.jobstream1
= USER : andyc
= Tue 08/01/17... (3 Replies)
Hi ,
I have a file which contains 2 days logs(here it is 24 and 25)
I want to list data only for date 25 fron the file.
please suggest me how should i get this.
file content mentioned below
17-05-24 Name Succ Fail
00:00:29 ... (5 Replies)
Hi Guys,
Am in need of your help one more time on my real data.
I have a file which contains more than thousand lines of data
Live data shown for 4 iterations. We have more than thousand lines of data:-
--------------------------------------------------------------------------
... (4 Replies)
Hello, How All are Doing today. I have a issue, I have a file which contains the data as follow
<ENVELOPE><ENVELOPE_ID>TEST</ENVELOPE_ID><ENVELOPE_EXTERNAL_ID></ENVELOPE_EXTERNAL_ID><ENVELOPE_VERSION>2</ENVELOPE_VERSION><SIResourceDefaultVersion>true</SIResourceDefaultVersion><TYPE>GS... (1 Reply)
Hi All,
I have a file with the below data as shown.
A|2|20120430
B|EMP|NAME|DEPT
C|12|SARC|01
C|23||ASDD|02
D|END OF FILE
I want to fetch only the records that contains C|, what is unix command to fetch this data.
Thanks (5 Replies)
Hi,
I am trying to fetch the different values in an xml file by searching with the same variable in AIX Server.
<name>SharedResources/Shared/JNDI/Username</name>
<value>admin</value> <name>SharedResources/Shared/JNDI/Username</name>
... (1 Reply)
Hi,
I got a requirement to fetch data between two time stamps in a big log file and grep for a word in that particular time interval of data.
Here is my log looks like:
2012/04/08-14:35:56 Abcdefg
2012/04/08-14:35:56 Hijklmnophhoishfw
2012/04/08-14:35:56... (1 Reply)
can anyone please suggest me some ideas for writing a korn shell script which will go back to 36 days from current day and print each day (incremented by 1) in the format yyyy-mm-dd until the current day.
Thanks
Mark (7 Replies)
Hi,
I have a task where i need to scan second column of seuential file and fetch first 3 digits of that column
For e.g. FOLLOWING IS THE SAMPLE FOR MY SEQUENTIAL FILE
AU_ID ACCT_NUM CRNCY_CDE
THHSBC001 30045678 THB
THHSBC001 10154267 THB
THHSBC001 ... (2 Replies)
I want to fetch passwords from a common file xxxx.txt and use it in a script.
Currently the password is hardcoded so this have to be changed so that password can be fetched from text file.....
Please reply asap..
Thanks (4 Replies)