Here's a perl script that extracts the data and creates the spreadsheet. However, it's still unclear which fields you want to extract, how the records are seporated (ie, is there a blank line between each record?), or how you want the spreadsheet data formated.
I assumed that ech record is seporated by a blank line, and you wanted to extract each field. The script does not set the cell format (size, color, etc), but that could be added.
I used Spreadsheet-WritExcel but there are lots of other Perl modules for dealing with spreadsheets.
http://search.cpan.org/search?query...
=======================================================================
#!perl
use warnings;
use strict;
use Spreadsheet::WriteExcel;
# create an empty spreadsheet with 1 worksheet
my $workbook = Spreadsheet::WriteExcel->new('class.xls');
my $worksheet = $workbook->add_worksheet();
# initialize the row and col positions
my ($row, $col) = 0,0;
# write the header row (using an anonymous array)
$worksheet->write_row($row, $col, ['Class', 'Name', 'Message', 'ID', 'Persistence', 'Module']);
# set the input record separator to a blank line
$/ = "\n\n";
# open a read filehandle to the raw data file
open (CLASS, "<", "class.txt") or die "can't open class.txt $!";
while (<CLASS>) {
my @data; # initialize an empty array to hold the record
# use multiple regex's to extract the data
# this can also be done with a single regex (regular expression)
($data[0]) = /CLASS "([^"]+)"/;
($data[1]) = /Name "([^"]+)"/;
($data[2]) = /MESSAGE_TYPE "([^"]+)"/;
($data[3]) = /CLASSID "([^"]+)"/;
($data[4]) = /PERSISTENCE_TYPE "([^"]+)"/;
($data[5]) = /MODULE_PREFIX "([^"]+)"/;
# create a reference to the data array
my $data = \@data;
# increment the row and write the data
$row++;
$worksheet->write_row($row, $col, $data);
}
$workbook->close() or die "Error closing spreadsheet file: $!";
close CLASS;