[please don't quote Google's -hide quoted text- rubbish]
Quoth (e-mail address removed):
(e-mail address removed) wrote:
I need help writing a script in perl that takes text files and parses
out specific
[...]
Well what meant by specifics, each person in this exmaple have an id
as follows:
Capitan id : 123456
Time arrival : 10:00:56
Time left : 12:11:23
Capitan id : 88456
Time arrival : 1100:56
Time left : 12:17:0
As for spreadsheet, excel file would work!
You will need to put SOME work into this. You'll have to
parse it into the various fields and you could use
Spreadsheet::WriteExcel to create an Excel file.
I've already wrote the code for Spreadsheet what is left parsing the
data and put them possibly into the has with their value.
You mean like
my @records;
{
open my $FILE, '<', 'file.txt'
or die "can't open file.txt: $!";
local $/ = '';
while (my $rec = <$FILE>) {
my @fields = split /\n/, $rec;
my %rec;
for (@fields) {
my ($k, $v) = /([^:]*) \s* : \s* (.*)/x
or die "invalid field: '$_'";
$rec{$k} = $v;
}
push @records, \%rec;
}
}
? Was that really so difficult?
Ben- Hide quoted text -
- Show quoted text -