Solved

24 hour script

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

808 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