prepare log for access

I need help with one of my log files I got following format:
This is only a smal part of the file !

.........
--------------------------------------
2003-08-05 12:23:13.939781
logNo : 1380008
Server started - Activate; 10.48.4.51

--------------------------------------
2003-08-05 12:23:15.732659

logNo : 1380008
Server started - drives; 10.48.4.51

--------------------------------------
2003-08-05 12:23:17.845895

logNo : 1380008
Server started - oltprogramm; 10.48.4.51

--------------------------------------

.............

I need this in following format:

date;time;event
....
2003-08-05;12:23:17;Server started - oltprogramm

I search the forum for comparable threads and tried it as csh script but the csh have problems with variables biger then 1000 entries.

Is there a posibility to use perl ?
I have no experience in perl!

Thanks in advance.
joerg

I'm only any good with php, but here's my two cents anyway. write a script to read the file, search (think ereg() or egrep_replace()) for \n characters, then stript them. Include a few lines to remove '-''s and entire lines containing 'logNo : '.

Your requirement is a little vague. Are you showing the output for your entire sample input? If so, how do you know which entries to skip?

Perl is a fine tool for such programs, as are awk, ruby, ... But understanding your problem adequately is one key to getting a solution. (I'm prejudiced: I would never recommend a shell for a job like this.)

Thanx for your replay,
but now I got a solution with a lot of unix commands.
regards joerg

This is only a small part:

grep -n 'search string' losed | cut -d ':' -f1 > found
set i = 1
while 1 == 1
set aktz = `sed -n ${i}p found`
@ i++
if $aktz == '' break
@ startaktz= ( $aktz - 2 )
set str1 = `sed -n $startaktz'p' losed | cut -c1-20`
set str2 = `sed -n $aktz'p' losed`
set str = "${str1};${str2}"
echo $str >> layer
end

Stuff like this reminds me why I don't use csh.:stuck_out_tongue: Here's an awk solution. On Solaris, you have to use /usr/xpg4/bin/awk; FreeBSD 4.8 uses nawk (and perhaps awk, but on 4.8 awk is gawk, though that's changing in 5.x ...)

#!/usr/xpg4/bin/awk -f

$1 ~ /^[0-9]{4}(-[0-9]{2}){2}$/ {
        # If the first field looks like
        # a date, use it and the second field
        date = $1
        time = substr($2, 1, 8)
    }
index($0, eventname) {
        # Found the event name, so spit out the
        # name with the previously gathered date
        # and time
        split($0, a, ";")
        print date ";" time ";" a[1]
    }

Put this in a file (call it "scanlog", perhaps) and mark it executable. Then invoke it like this:

scanlog -v event=oltprogramm <losed >layer

The entire thing operates in a single pass over the file with a single process. Your solution creates 4 * n + 1 processes, where "n" is the number of events that matches your input pattern.