in reply to Re^2: Script works in XP but not Ubuntu?
in thread Script works in XP but not Ubuntu?
#@data = SplitCSVLine($csv_line); sub SplitCSVLine { my ($line) = @_; my ($value, @data); while(1) { last if($line =~ /^\s*$/); if($line =~ /^[^\"]/) { $line =~ s/(.*?)(,|$ )//x; $value = $1; } else { $line =~ s/\"((\"\"|[^\"])*)\"(,|$ )//x; $value = $1; $value =~ s/\"\"/\"/g if defined $value; } push @data, $value; } return @data; }
sub GetStyleCodesMap { my @csv_lines = chrtoolbox::MyCat('style_codes.csv'); my $line_num = 0; foreach my $line (@csv_lines) { $line_num++; next if($line_num == 1); #skip the header last if($line eq "\n"); #done reading the mapping @data = SplitCSVLine($line);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Script works in XP but not Ubuntu?
by jethro (Monsignor) on Apr 02, 2009 at 03:17 UTC | |
|
Re^4: Script works in XP but not Ubuntu?
by ig (Vicar) on Apr 02, 2009 at 09:25 UTC | |
by Anonymous Monk on Apr 02, 2009 at 09:43 UTC |