Finance::AMEX::Transaction - Parse AMEX transaction files: EPRAW, EPPRC, EPTRN, CBNOT, GRRCN
version 0.005
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"; } }
This module parses AMEX transaction files and returns object that are appropriate for the line that it was asked to parse.
Creates a new Finance::AMEX::Transaction object. Required options are file_type).
file_type
my $cbnot = Finance::AMEX::Transaction->new(file_type => 'CBNOT');
Sets the type of file that we are parsing. Valid values are:
returns Finance::AMEX::Transaction::EPRAW objects.
returns Finance::AMEX::Transaction::EPPRC objects.
returns Finance::AMEX::Transaction::EPTRN objects.
returns Finance::AMEX::Transaction::CBNOT objects.
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 should be auto-detected after the first row is parsed.
Should be one of FIXED, CSV, TSV.
The file is in a fixed width format.
The file has comma separated values.
The file has tab separated values.
file_version
Sets the version of the file we are parsing. Currently only useful for Finance::AMEX::Transaction::GRRCN files. This should be auto-detected after the HEADER row is parsed.
Should be one of 1.01, 2.01, 3.01.
Access method for the file type you set when calling new
new
Access method for the file formatted type that was set when calling new or was auto-detected after the first row is parsed.
Access method for the file version that was set when calling new or was auto-detected after the HEADER row is parsed.
Access method for the parser that is set depending on file_type
When passed a filehandle, takes the next line from the file and returns the appropriate object.
my $record = $cbnot->getline($fh);
Parses a single line from a file and returns the appropriate object.
Finance::AMEX::Transaction - Parse AMEX transaction files: EPRAW, EPPRC, EPA, CBNOT, GRRCN
Tom Heady <cpan@punch.net>
This software is copyright (c) 2022 by ZipRecruiter/Tom Heady.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Finance::AMEX::Transaction, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Finance::AMEX::Transaction
CPAN shell
perl -MCPAN -e shell install Finance::AMEX::Transaction
For more information on module installation, please visit the detailed CPAN module installation guide.