@@ -, +, @@ issues doesn't work as described a) SUPPLIER=aqbooksellers.name|TITLE=subscription.title|ISSUENUMBER=serial.serialseq|LATE SINCE=serial.planneddate b) aqbooksellers.name|TITLE=subscription.title|ISSUE NUMBER=serial.serialseq|LATE SINCE=serial.planneddate --- serials/lateissues-export.pl | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) --- a/serials/lateissues-export.pl +++ a/serials/lateissues-export.pl @@ -46,14 +46,19 @@ my $csv = Text::CSV_XS->new({ my $content = $csv_profile->content; my ( @headers, @fields ); while ( $content =~ / - ([^=]+) # header - = - ([^\|]+) # fieldname (table.row or row) + ([^=\|]+) # header + =? + ([^\|]*) # fieldname (table.row or row) \|? /gxms ) { - push @headers, $1; - my $field = $2; - $field =~ s/[^\.]*\.?//; # Remove the table name if exists. + my $header = $1; + my $field = ($2 eq '') ? $1 : $2; + + $header =~ s/^\s+|\s+$//g; # Trim whitespaces + push @headers, $header; + + $field =~ s/[^\.]*\.{1}//; # Remove the table name if exists. + $field =~ s/^\s+|\s+$//g; # Trim whitespaces push @fields, $field; } --