Switch to ; delimited only if we don't have ; in first line
(which is some cruft in my file)
This allowes me to read in "normal" csv files with ease
my @lines = split(/\r?\n/, $data);
$data = { items => [] };
- my $delimiter = qr/;/;
+ my $delimiter = qr/,/;
+
+ if ( $lines[0] !~ /;/ && $lines[1] =~ /;/ ) {
+ shift @lines; # FIXME ship non-header line
+ $delimiter = qr/;/;
+ }
- shift @lines; # FIXME ship non-header line
my $header_line = shift @lines;
my @header = split( $delimiter, $header_line );