To extract data of a perticular interval (date-time wise)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting To extract data of a perticular interval (date-time wise)
# 1  
Old 07-03-2008
Error To extract data of a perticular interval (date-time wise)

I want a shell script which extract data from a log file which contains date and time-wise data and i need the data for a perticular interval of time...what can i do???
# 2  
Old 07-03-2008
Show us a sample of the log file, and an example of the kind of criteria you need to filter on?
# 3  
Old 07-03-2008
07/01/08:21:45:00 72% 82% 15% 1626560 429712 878148 339500 746080 313584 592964 629668 2 314834 355136 1 355136 255400 1
07/01/08:21:46:00 72% 82% 15% 1626560 429712 878148 339500 746080 313584 592964 629668 2 314834 355136 1 355136 255400 1
07/01/08:21:47:00 72% 82% 15% 1626560 429712 878148 339500 746080 313584 592964 629668 2 314834 355136 1 355136 255400 1
07/01/08:21:48:00 72% 82% 15% 1626560 429712 878148 339500 746080 313584 592964 629668 2 314834 355136 1 355136 255400 1
07/01/08:21:49:00 72% 82% 15% 1626560 429712 878148 339500 746080 313584 592964 629668 2 314834 355136 1 355136 255400 1
07/01/08:21:50:00 72% 82% 15% 1626560 429712 878148 339500 746080 313584 592964 629668 2 314834 355136 1 355136 255400 1
e.g. i need to filter the middle two lines by date and time from the above data.
# 4  
Old 07-03-2008
Would grep '07/01/08:21:4[78]:00' datafile be enough?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Extract date and time part from filename

Hi, I am facing one scenario in which I need to extract exact position of date and time from the name of the files. For example, Below is the record in which I need to extract position of YYYYMMDD,HHMISS and YYMMDD. Date and time variables can come more than once. I need to use these position... (13 Replies)
Discussion started by: Prathmesh
13 Replies

2. UNIX for Beginners Questions & Answers

How to extract date and time from filename?

Hi, I'm totally new in sell script and working with a shell code. I want to extract the date and time from the filenames. The filenames are different but all of them begins with WI_ SCOPE_: WI_SCOPE_DATA_CHANGE_2017-09-12_15-30-40.txt WI_SCOPE_BACK_COMPLETE_QUEUE_2017-09-12_15-31-40.txt... (5 Replies)
Discussion started by: Home
5 Replies

3. Shell Programming and Scripting

Extract count of string in all files and display on date wise

Hi All, hope you all are doing well! I kindly ask you for shell scripting help, here is the description: I have huge number of files shown below on date wise, which contains different strings(numbers you can say) including 505001 and 602001. ... (14 Replies)
Discussion started by: VasuKukkapalli
14 Replies

4. Shell Programming and Scripting

Extract data from log file within specified time

So, we have a script, that is supposed to have a couple of functions like showing number of failed connections, recieved bytes per IP-address, and so on. We are supposed to be able to limit the number of results to either 0-24 hours or X days back from the last data in the log file. Everything... (3 Replies)
Discussion started by: Plumpen
3 Replies

5. Shell Programming and Scripting

Extract date / time

How do i display in the below format without the brackets using shell script. Tue Oct 1 13:32:40 2013 Please use CODE tags not only for all code segments, input samples, and output samples. (7 Replies)
Discussion started by: ghosh_tanmoy
7 Replies

6. Shell Programming and Scripting

Script (ksh) to get data in every 30 mins interval for the given date

Hello, Since I m new to shell, I had a hard time to sought out this problem. I have a log file of a utility which tells that batch files are successful with timestamp. Given below is a part of the log file. 2013/03/07 00:13:50 Apache/1.3.29 (Unix) configured -- resuming normal operations... (12 Replies)
Discussion started by: rpm120
12 Replies

7. Shell Programming and Scripting

To extract date and time separately from the file name

Hi., My current script extracts only if the date and time are in 3rd and 4th pos. #!/bin/bash echo "Enter the file name to extract the timestamp" read fname IFILE=$fname F=$IFILE IFS="_." f=($F) echo "Date ${f} Time ${f}" How to generalize the script to extract the... (3 Replies)
Discussion started by: IND123
3 Replies

8. Shell Programming and Scripting

How to extract date with time from file

Hi, I have a file where there is a date and time field, the format for it is yyyy-mm-dd hours:mins:sec the position of date field may vary anywhere in the line and it might be different and it is specified along with the variable AppTimeStamp how do i extract date and time both from the... (5 Replies)
Discussion started by: prash_b
5 Replies

9. Shell Programming and Scripting

to get list of files of a perticular range of time

hi, how to list the files which has been created or accessed before 6 months thanks (1 Reply)
Discussion started by: useless79
1 Replies

10. Shell Programming and Scripting

extract perticular lines and make them into speadsheet

Hi Masters, I knew this isn't a new issue, but couldn't find any similar threads. So, I have to bother you. Here is my input file (genomic data). The file has many sessions, each session seperated by //. Within eash session there is only one ID and GN line. ID 3HAO_HUMAN STANDARD; ... (4 Replies)
Discussion started by: mskcc
4 Replies
Login or Register to Ask a Question