Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision efb48636

Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt

  • ID efb48636914ed5b5d74417091887ab7314f47bea
  • Vorgänger 90af0ce7
  • Nachfolger 45119ead

Kosmetik, Typos

Unterschiede anzeigen:

SL/Helper/Csv.pm
203 203
    file        => \$::form->{upload_file},
204 204
    encoding    => 'utf-8', # undef means utf8
205 205
    sep_char    => ',',     # default ';'
206
    quote_char  => ''',     # default '"'
207
    header      => [qw(id text sellprice word)] # see later
208
    profile    => { sellprice => 'sellprice_as_number' }
206
    quote_char  => '\'',    # default '"'
207
    escape_char => '"',     # default '"'
208
    header      => [qw(id text sellprice word)], # see later
209
    profile     => { sellprice => 'sellprice_as_number' },
209 210
    class       => 'SL::DB::CsvLine',   # if present, map lines to this
210
  )
211
  );
211 212

  
212 213
  my $status  = $csv->parse;
213 214
  my $hrefs   = $csv->get_data;
......
265 266
=item C<encoding>
266 267

  
267 268
Encoding of the CSV file. Note that this module does not do any encoding
268
guessing.  Know what your data ist. Defaults to utf-8.
269
guessing. Know what your data is. Defaults to utf-8.
269 270

  
270 271
=item C<sep_char>
271 272

  
......
292 293
In case of a One-To-One relationsship these can also be set over
293 294
relationsships by sparating the steps with a dot (C<.>). This will work:
294 295

  
295
  { customer => customer.name }
296
  { customer => 'customer.name' }
296 297

  
297 298
And will result in something like this:
298 299

  
......
325 326

  
326 327
 [
327 328
 0  offending raw input,
328
 1  Text::CSV error code if T:C error, 0 else,
329
 1  Text::CSV error code if Text:CSV signalled an error, 0 else,
329 330
 2  error diagnostics,
330 331
 3  position in line,
331 332
 4  estimated line in file,

Auch abrufbar als: Unified diff