NAME

ETLp::File::Read::CSV - audit the execution of an ETLp job

DESCRIPTION

This class is used to manage the job's audit record

SYNOPSIS

use ETLp::File::Read::CSV;

my $csv = ETLp::File::Read::CSV->new(
    filename    => "/data/comit/final.csv",
    fields      => [qw/id name score/],
    csv_options => {allow_whitespace => 1},
    localize    => 1,
);

while (my $fields = $csv->get_fields) {
    print $csv->line_counter() .": " . $csv->{name}, "\n";
};

METHODS

new

Create a File object.

Parameters

Hash or hashref consisting of

* filename: Required. Name  of the file to be opened
* fields: Required. The fields in the file
* csv_options. Optional. Settings for parsing the CSV file. See
  Text::CSV documentation
* localize. Optional. Whether the end of line characters should be
  converted to the native ones
  

Returns

* a ETLp::File::Read::CSV object

get_fields

Extracts the fields from a file

Parameters

* None

Returns

* A hashref where each key is populated with the filed value from the
  file record

LICENSE AND COPYRIGHT

Copyright 2010 Redbone Systems Ltd

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

The terms are in the LICENSE file that accompanies this application