avoid trimming trailing empty fields
authorJason Etheridge <jason@EquinoxInitiative.org>
Wed, 20 Feb 2019 03:28:36 +0000 (22:28 -0500)
committerJason Etheridge <jason@EquinoxInitiative.org>
Wed, 20 Feb 2019 03:28:36 +0000 (22:28 -0500)
text/join_lines_if_short

index 1400104..9e45adc 100755 (executable)
@@ -75,7 +75,7 @@ while (my $line = <>) {
     } else {
         $line_buffer = "$line_buffer$join_delimiter$line";
     }
-    my @f = split /$delimiter/, $line_buffer;
+    my @f = split /$delimiter/, $line_buffer, -1;
     if (scalar(@f) >= $colcount) {
         $line_buffer =~ s/\x0D//g; # strip embedded carriage returns
         print "$line_buffer\n";