Tom Heady
and 1 contributors

NAME

Finance::AMEX::Transaction - Parse AMEX transaction files: EPRAW, EPPRC, EPTRN, CBNOT, GRRCN

VERSION

version 0.002

SYNOPSIS

  use Finance::AMEX::Transaction;

  my $cbnot = Finance::AMEX::Transaction->new(file_type => 'CBNOT');
  open my $fh, '<', '/path to CBNOT file' or die "cannot open CBNOT file: $!";

  while (my $record = $cbnot->getline($fh)) {

    if ($record->type eq 'TRAILER') {
      print $record->FILE_CREATION_DATE . "\n";
    }
  }

DESCRIPTION

This module parses AMEX transaction files and returns object that are appropriate for the line that it was asked to parse.

METHODS

new

Creates a new Finance::AMEX::Transaction object. Required options are file_type).

 my $cbnot = Finance::AMEX::Transaction->new(file_type => 'CBNOT');
file_type (required)

Sets the type of file that we are parsing. Valid values are:

EPRAW

returns Finance::AMEX::Transaction::EPRAW objects.

EPPRC

returns Finance::AMEX::Transaction::EPPRC objects.

EPTRN

returns Finance::AMEX::Transaction::EPTRN objects.

CBNOT

returns Finance::AMEX::Transaction::CBNOT objects.

GRRCN

returns Finance::AMEX::Transaction::GRRCN objects.

file_format

Sets the format of the file that we are parsing. Currently only useful for Finance::AMEX::Transaction::GRRCN files. This can usually be auto-detected.

Should be one of FIXED, CSV, TSV.

fixed

The file is in a fixed width format.

csv

The file has comma seperated values.

tsv

The file has tab seperated values.

file_type

Access method for the file type you set when calling new

file_format

Access method for the file formated type that was set when calling new or was auto-detected.

parser

Access method for the parser that is set depending on file_type

getline

When passed a filehandle, takes the next line from the file and returns the appropriate object.

 my $record = $cbnot->getline($fh);

parse_line

Parses a single line from a file and returns the appropriate object.

NAME

Finance::AMEX::Transaction - Parse AMEX transaction files: EPRAW, EPPRC, EPA, CBNOT, GRRCN

AUTHOR

Tom Heady <theady@ziprecruiter.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2018 by ZipRecruiter.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.