Revision 7459b01b
Von Sven Schöling vor mehr als 8 Jahren hinzugefügt
SL/Controller/CsvImport.pm | ||
---|---|---|
239 | 239 |
return; |
240 | 240 |
} |
241 | 241 |
|
242 |
my $csv = Text::CSV_XS->new({ |
|
243 |
binary => 1, |
|
244 |
sep_char => $self->profile->get('sep_char'), |
|
245 |
quote_char => $self->profile->get('quote_char'), |
|
246 |
escape_char => $self->profile->get('escape_char'), |
|
247 |
}); |
|
248 |
|
|
249 |
my $header = $csv->getline($file->fh) or do { |
|
250 |
$self->js |
|
251 |
->flash('error', t8('No header found')) |
|
252 |
->render; |
|
253 |
return; |
|
254 |
}; |
|
242 |
my $csv = SL::Helper::Csv->new( |
|
243 |
file => $file->file_name, |
|
244 |
map { $_ => $self->profile->get($_) } qw(sep_char escape_char quote_char), |
|
245 |
); |
|
246 |
|
|
247 |
$csv->_open_file; |
|
248 |
my $header = $csv->check_header; |
|
255 | 249 |
|
256 | 250 |
for my $field (@$header) { |
257 | 251 |
next if $self->mappings_for_profile->{$field}; |
Auch abrufbar als: Unified diff
CsvImport Mapping: header mit helper parsen
sonst gibt es wieder die gleichen Probleme mit UTF-BOM