Changeset 13173


Ignore:
Timestamp:
2006-10-27T13:54:06+13:00 (18 years ago)
Author:
mdewsnip
Message:

Fixed problem where Unix line endings weren't being dealt with correctly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/MetadataCSVPlug.pm

    r12606 r13173  
    103103
    104104    # Split the file into lines and read the first line (contains the metadata names)
    105     $csv_file_content =~ s/\n//g;
    106     my @csv_file_lines = split(/\r/, $csv_file_content);
     105    $csv_file_content =~ s/\r/\n/g;  # Handle non-Unix line endings
     106    $csv_file_content =~ s/\n+/\n/g;
     107    my @csv_file_lines = split(/\n/, $csv_file_content);
    107108    my $csv_file_field_line = shift(@csv_file_lines);
    108109    my @csv_file_fields = split(/\,/, $csv_file_field_line);
Note: See TracChangeset for help on using the changeset viewer.