Solved

24 hour script

Posted on 2004-09-03
3
162 Views
Last Modified: 2013-12-26
Sample of the file I have to extract data from:

Khaoki is begun 2003/07/02 01:00:10
It’s a girl
She works
She enjoys computers
Khaoki is ended 2003/07/02/01:00:30
Khaoki is begun 2003/07/02 01:10:10
It’s a girl
She works
She enjoys computers
Khaoki is ended 2003/07/02/01:10:21
Khaoki is begun 2003/07/02 01:20:10
It’s a girl
She works
She enjoys computers
What a snazzy lady
Khaoki is ended 2003/07/02/01:20:54
Khaoki is begun 2003/07/02 01:30:10
It’s a girl
She works
She enjoys computers
Khaoki is ended 2003/07/02/01:30:45
Khaoki is begun 2003/07/02 01:40:10
It’s a girl
A lady that needs asistance
She works
She enjoys computers
Khaoki is ended 2003/07/02/01:40:21
Khaoki is begun 2003/07/02 01:50:10
It’s a girl
She works
How is it being in Unix
She enjoys computers
Khaoki is ended 2003/07/02/01:50:21

Thanks,the cron part I know.The problem is the script. I must extract from the first statement of a file.The process is from Khaoki is begun and it ends at the line where there is Khaoki is ended.The process executes every few minutes,for an example 10 minutes. And each process is unique, meaning that the lines in between begun and ended are not equal(Not the same amount).

0
Comment
Question by:khaoki
3 Comments
 
LVL 20

Accepted Solution

by:
tfewster earned 50 total points
Comment Utility
I'm not sure what you're trying to achieve - Could you post an example of the end result you want to get?

You can use awk to split the file into "records", e.g.
awk 'BEGIN {RS="Khaoki is ended"} {print $0 "End of record\n"}' < logfile
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
if loop error 4 76
Whole sheet autoscrub still needed 19 44
lucky13 challenge 11 111
NotAlone Challenge 20 70
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now