We help IT Professionals succeed at work.
Get Started

Extract data from text file

492 Views
Last Modified: 2014-03-13
Hey Experts!  I need to check a log file on several servers daily.  Rather than checking them everyday, I was hoping I could run a script and dump out the most recent data.  Here is a brief sample of the data:

03/04/2014 19:07:45 --- SCHEDULEREC QUERY BEGIN
03/04/2014 19:07:45 --- SCHEDULEREC QUERY END
03/04/2014 19:07:45 Next operation scheduled:
03/04/2014 19:07:45 ------------------------------------------------------------
03/04/2014 19:07:45 Schedule Name:         DAILYINC_7PM
03/04/2014 19:07:45 Action:                Incremental
03/04/2014 19:07:45 Objects:              
03/04/2014 19:07:45 Options:              
03/04/2014 19:07:45 Server Window Start:   19:00:00 on 03/05/2014
03/04/2014 19:07:45 ------------------------------------------------------------
03/04/2014 19:07:45 Schedule will be refreshed in 12 hours.
03/05/2014 07:07:45 TSM Backup-Archive Client Version 6, Release 4, Level 0.11  
03/05/2014 07:07:45 Querying server for next scheduled event.
03/05/2014 07:07:45 Node Name: ---
03/05/2014 07:07:45 Session established with server ---: Linux/x86_64
03/05/2014 07:07:45   Server Version 6, Release 3, Level 4.0
03/05/2014 07:07:45   Server date/time: 03/05/2014 07:07:45  Last access: 03/04/2014 19:07:45

03/05/2014 07:07:45 --- SCHEDULEREC QUERY BEGIN
03/05/2014 07:07:45 --- SCHEDULEREC QUERY END
03/05/2014 07:07:45 Next operation scheduled:
03/05/2014 07:07:45 ------------------------------------------------------------
03/05/2014 07:07:45 Schedule Name:         DAILYINC_7PM
03/05/2014 07:07:45 Action:                Incremental
03/05/2014 07:07:45 Objects:              
03/05/2014 07:07:45 Options:              
03/05/2014 07:07:45 Server Window Start:   19:00:00 on 03/05/2014
03/05/2014 07:07:45 ------------------------------------------------------------
03/05/2014 07:07:45 Schedule will be refreshed in 12 hours.
03/05/2014 19:07:45 TSM Backup-Archive Client Version 6, Release 4, Level 0.11  
03/05/2014 19:07:45 Querying server for next scheduled event.
03/05/2014 19:07:45 Node Name: ----
03/05/2014 19:07:45 Session established with server ---: Linux/x86_64
03/05/2014 19:07:45   Server Version 6, Release 3, Level 4.0
03/05/2014 19:07:45   Server date/time: 03/05/2014 19:07:45  Last access: 03/05/2014 09:04:24

I would like the script to look for data with a certain date, set by me manually.  I need to copy the data found that matches the date (example 3/05/2014) to one, central log file.

So experts, how does one do this?  :)

Thanks in advance.
Comment
Watch Question
CERTIFIED EXPERT
Most Valuable Expert 2019
Most Valuable Expert 2018
Commented:
This problem has been solved!
Unlock 2 Answers and 14 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE