>1. Copy all lines from a log file which matches a certain 'datecode' >(yyyymmddhh) (the starting column of this code is known) into a new >filename with the same datecode. > >line example: 56656 3 106256 0 0 52006022309509 48602 0.0 >0 1 0
That looks suspiciously like PBX log data. Am I right? I just dumped it all to a database and let it do all the work when I did this project. Then built a web application to access it. But if u seriously want to speed up ur code u need to do ur own IO and use index and substr rather than the regex engine. Also minimize block entries. >1. Extract the datecodes (there's more than one) from the logfile (without >having to read every line.. ) >2. 'grep' all lines matching a certain datecode and dump it to the target >file (with the same datecode) If ur set on text files then the way to do this is to have one pass through the file create all of the text files. So however many datecodes there are, that's how many text files u get. It makes no sense to parse those multi hundred megabyte files over and over again. If u can tell us what ur ultimate desired output is we might have some better pointers. -- REMEMBER THE WORLD TRADE CENTER ---=< WTC 911 >=-- "...ne cede malis" 00000100 _______________________________________________ Perl-Win32-Users mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
