Greetings,

I have a directory full of invidual GEN000*.Result files. Each one of these files has some output which looks like this:

PDI Number: GEN000240
Finding Category: CAT I
Reference: UNIX STIG: 2.5.3.1
Description: A non-local/non-authoritative (Government) time-server is used.
Status: Not Reviewed

For example:
GEN000240: Please perform a manual review of the domain.net network time server/client
using Checklist Section 3, GEN000240, to check the configuration.

SRR Script Version: UNIX_51-28Jan2011
UNIX SRR Checklist Page: 28


I want to parse over 300 of these into a single excel or csv file. I wanted to put each line into a new column. How do I parse/convert something like this?

I was thinking to do a forloop thru the files and then parse the files via each field to the csv. Or is there a better way to do this? Should I get an IDE type of program to help with this or is it pretty easy to put together?

This is what I was able to put together so far:

#!/usr/bin/perl -w

 @files = <data/GEN*.Result>;
 foreach $file (@files) {
   print $file . "\n";
 }

-Overkill





--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to