Solved

24 hour script

Posted on 2004-09-03
3
166 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 21

Accepted Solution

by:
tfewster earned 50 total points
ID: 11977019
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 47
Expand LInux Boot partition remotly 3 102
if loop in java 3 161
mapAB Challlenge 35 172
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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.

740 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