in reply to pulling fields out of a ascii print file

Anonymous Monk,
May I suggest Data Munging with Perl as a good place to start. I would also highly recommend Mastering Regular Expressions. I am going to give your problem a stab just because I haven't ever done something like this before in Perl.

Beware untested code - dragons lie ahead!

#!/usr/bin/perl -w use strict; open (INPUT,"file") or die "Unable to open file : $!"; open (OUTPUT,">outfile") or die "Problem with outfile : $!"; select OUTPUT; $/ = ""; $\ = "\n"; my @data; my $foo; my $bar; while (<INPUT>) { my @lines = split /\n/; my $blah; while (my $line = shift @lines) { $line =~ s/^\s*//; last if ($line =~ /^Total/); next if (/^\s*$/); if ($line =~ /^([^:]*):(.*)$/) { $foo = $1; $bar = $2; next; } elsif ($line =~ /^(\d+)$/) { $blah = $1; next; } else { my @stuff = split /\s{2,}/ , $line; push @data , join ',' , ($bar, "\"$foo\"", $blah, "\"$stuf +f[0]\"", "\"$stuff[1]\"", $stuff[2]); } } } print foreach(@data);
Now as I said - I wrote that code just because I have never done this sort of thing before. That means I am not very experienced and there is most likely a better way.

Cheers - L~R