Solved

24 hour script

Posted on 2004-09-03
3
170 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

623 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