Ignore:
Timestamp:
2019-02-25T22:21:24+13:00 (5 years ago)
Author:
davidb
Message:

Change of option name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/model-sites-dev/heritage-nz/collect/reports-2019/perllib/plugins/CSVPlugin.pm

    r32812 r32817  
    116116    my $csv_file_field_line = $1;
    117117
    118     my $separate_char = $self->{'separate_char'};
     118    my $separate_char = $self->{'csv_field_separator'};
    119119    if ($separate_char =~ m/^auto$/i) {
    120120    $separate_char = $self->resolve_auto($csv_file_field_line,$self->{'plugin_type'},$self->{'outhandle'},$self->{'verbosity'});
     
    133133    }
    134134
    135     # $csv_file_field_line .= $separate_char;  # To make the regular expressions simpler # ****
    136 
    137     # while ($csv_file_field_line ne "") {
    138     #   # Handle quoted values
    139     #   if ($csv_file_field_line =~ s/^\"(.*?)\"${separate_char}//) { # ****
    140     #       my $csv_file_field = $1;
    141     #       $csv_file_field =~ s/ //g;  # Remove any spaces from the field names
    142     #       push(@csv_file_fields, $csv_file_field);
    143     #   }
    144     #   # Normal comma-separated case
    145     #   elsif ($csv_file_field_line =~ s/^(.*?)${separate_char}//) { # ****
    146     #       my $csv_file_field = $1;
    147     #       $csv_file_field =~ s/ //g;  # Remove any spaces from the field names
    148     #       push(@csv_file_fields, $csv_file_field);
    149     #   }
    150     #   # The line must be formatted incorrectly
    151     #   else {
    152     #       print STDERR "Error: Badly formatted CSV field line: $csv_file_field_line.\n";
    153     #       last;
    154     #   }
    155     # }
    156 
    157135    $self->{'csv_file_fields'} = \@csv_file_fields;
    158136
    159     print STDERR "****** csv file fields joined = ", join(" ||| ", @{$self->{'csv_file_fields'}}), "\n";
     137    # print STDERR "**** CSV file fields joined = ", join(" ||| ", @{$self->{'csv_file_fields'}}), "\n";
    160138}
    161139
     
    196174    }
    197175
    198 
    199 
    200     # # Build a hash of metadata name to metadata value for this line
    201     # my $i = 0;
    202     # $csv_line .= $separate_char;  # To make the regular expressions simpler # ****
    203     # while ($csv_line ne "") {
    204     #   # Metadata values containing commas are quoted
    205     #   if ($csv_line =~ s/^\"(.*?)\"${separate_char}//) { # ****
    206     #       # Only bother with non-empty values
    207     #       my $match = $1;
    208     #       if ($match ne "" && defined($csv_file_fields[$i])) {
    209     #       $doc_obj->add_utf8_metadata($section, $csv_file_fields[$i], $match);
    210     #       }
    211     #   }
    212     #   # Normal comma-separated case
    213     #   elsif ($csv_line =~ s/^(.*?)${separate_char}//) { # ****
    214     #       # Only bother with non-empty values
    215     #       my $match = $1;
    216     #       if ($match ne "" && defined($csv_file_fields[$i])) {
    217     #       $doc_obj->add_utf8_metadata($section, $csv_file_fields[$i], $match);
    218     #       }
    219     #   }
    220     #   # The line must be formatted incorrectly
    221     #   else {
    222     #       print STDERR "Error: Badly formatted CSV line: $csv_line.\n";
    223     #       last;
    224     #   }
    225 
    226     #   $i++;
    227     # }
    228 
    229176    # Record was processed successfully
    230177    return 1;
Note: See TracChangeset for help on using the changeset viewer.