#!/bin/bash

# first, get rid of theses #@!$ \r
sed -e 's///g' $1 > $1.new

cat $1.new | cut -f 2- -d':' | while (:)
do
        read date;
        read method;
        read server;
        read user;
        read clientip;
        read serverip;
        read domain;
        read ctype;
        read clength;
        read path;
        read op;
        read line;
        NDate=`date -d "$date" +'%d/%b/%Y:%H:%M:%S +0100'`
        echo "$clientip - - [$NDate] \"$op $domain/$path HTTP/1.1\" 200 $clength \"http://dev/null\" \"CuiCui Browser\""
        #break;
done;

