eyal edri wrote:

> what i did and it's not good enough:
> 
> 1. i've implemented this using ordinary "foreach $line (@lines)" file
> processing, which is very slow when handeling large files.
>     and then it's quite easy. (using substr and such...).
> 
> what i think needs to be done (and here i need your advice):
> 
> 1. Extract the datecodes (there's more than one) from the logfile
> (without having to read every line.. )

Not possible.  You can't extract without reading.

> 2. 'grep' all lines matching a certain datecode and dump it to the
> target file (with the same datecode)
>     (while checking if the length of each lines should be
> chopped/limited to XX CHARS.)

You seem to be doing that already (line by line).

> I know that using ''awk''/''sed''/"grep" suppose to produce better results.

Probably true.

> Also using regular expressions will probably improve performance.

No - that should slow you down even more.

Try showing us the code you have and see if it can be sped up, but it
sounds like you were on the right track to start with.
_______________________________________________
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to