in reply to A Slough of ParseRecDescent Woes
You wrote:
As it turns out, each line of the file represents one type of quote and the format and the format, while consistent for each quote type, varies from type to type. In other words, one line may have five fields and the next line may have eight.
It seems to me that by the time you've done something like
while(<DATA>) { chomp; my @line = split(',',$_); }
It seems to me that anything from @line[1..(@line-3)]
is the data you are interested in. This is one way to deal
with variable-length fields in your data:
#!/usr/bin/perl while(<DATA>) { chomp; /^$/ and next; my @line = split(/,/,$_); for(@line[1..(@line-3)]) { /\d+\.[\d]{4}/ or next; printf("%s\t%s\n",$line[0],$_); } } exit;
I haven't done any of the nifty stuff you are doing-
building references etc.- because I still have a hard time
grokking them...
Tentatively,
blyman
|
|---|