Hi, GlenM <glenmill...@gmail.com> wrote: > I am sure that someone out there has done this before - I *think* I am > on the right track. > > I have a directory full of emails. What I would like to do is read > each file in, then parse them into a CSV style file.
Quick aside: you can use the $. builtin variable to get the line number instead of keeping track of it yourself. Since you asked for suggestions, here's my $0.02: Putting mails line by line into a CSV files seems futile to me, since the number and position of mail headers is variable. If you want to create a database of your mails or do some other sort of data mining I would suggest that you look at something like the MIME-Tools bundle[1] to do the actual parsing and the concentrate on doing something useful with the extracted information. HTH, Thomas 1) http://search.cpan.org/~doneill/MIME-tools-5.427/lib/MIME/Tools.pm -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/