|Syntactic Confectionery Delight|
Re: Parsing a log fileby grizzley (Chaplain)
|on Nov 29, 2007 at 14:41 UTC||Need Help??|
This is not the answer or help in the problem but hint how to make things other way.
You could consider using -n or -p switch to ease your script. I use it all the time and it really saves me much thinking about file names and handles and other stuff like error handling.
1. Reading. Instead of
and running like this:
and run like this
2. Writing. Instead of opening CSV file and printing to it, print to STDOUT. And redirect to file like this:
Regardless which switch you choose, use the script like this:
C:\>myscript.pl input_file.txt > OUTPUT.csv