http://www.perlmonks.org?node_id=1009486

OodaLoop has asked for the wisdom of the Perl Monks concerning the following question:

I for the life of me cannot find a useful example for my needs. I am looking for a simple example of parsing a text file and creating a CSV file. For example something that converts this text file:

Line1info Line2someMoreInfo Line3 more info Line5line4IsBlank Line6isTabbed Line7isToo Line8hasMoreStuff

into this CSV file:

Line1, Line3, Line6, Line7 Line1info, Line3 more info, Line6isTabbed, Line7isToo

I figured this would be a common request but apparently I was wrong. Every example I've found does not fit the bill. If someone could point me to an example that I could use as a template to learn from that would be great. If it is easy to produce an example from the generic data I provided that would be great too.

Just in case being more specific is helpful, here is exactly what I'm trying to do

Flat File

NetDevice1234 Kernel: Linux 2.6.18-164.11 Version: Driver 23.4.1 333.0 Hotfix BLD Edition Hot fixes: HF372590 HF372804 HF372864 Enabled Features: FTP HTTP SMTP Active Directory

Into a CVS with the following contents:

Host, OS, Version, Hot Fixes, Features NetDevice1234, Linux 2.6.18-164.11, Driver 23.4.1 333.0 Hotfix BLD Edi +tion, HF372590 HF372804 HF372864, FTP HTTP SMTP Active Directory

Thanks for any help you can provide everyone!