[BACK]Return to pta_import.1 CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / pta

Annotation of pta/pta_import.1, Revision 1.13

1.13    ! freda       1: .\" $Id: pta_import.1,v 1.12 2020/12/03 14:17:39 freda Exp $
1.1       schwarze    2: .\"
                      3: .\" Copyright (c) 2020 Freda Bundchen
                      4: .\"
                      5: .\" Permission to use, copy, modify, and distribute this software for any
                      6: .\" purpose with or without fee is hereby granted, provided that the above
                      7: .\" copyright notice and this permission notice appear in all copies.
                      8: .\"
                      9: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                     10: .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                     11: .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                     12: .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                     13: .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                     14: .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                     15: .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                     16: .\"
1.13    ! freda      17: .Dd $Mdocdate: December 3 2020 $
1.1       schwarze   18: .Dt PTA_IMPORT 1
                     19: .Os
                     20: .Sh NAME
                     21: .Nm pta_import
                     22: .Nd print pta journal entries from bank CSV file input
                     23: .Sh SYNOPSIS
                     24: .Nm pta_import
1.5       schwarze   25: .Fl I Ar accountname
1.2       schwarze   26: .Op Ar file
1.1       schwarze   27: .Sh DESCRIPTION
                     28: The
                     29: .Nm
1.2       schwarze   30: utility converts lines from a CSV
                     31: .Ar file
                     32: generated by a financial
1.1       schwarze   33: institution into journal entries used by
                     34: .Xr pta 1 .
1.2       schwarze   35: .Pp
                     36: If the
                     37: .Ar file
                     38: argument is omitted, standard input is read instead.
1.3       schwarze   39: .Pp
1.5       schwarze   40: .Ar accountname
1.3       schwarze   41: is exactly one of
1.4       schwarze   42: .Pp
                     43: .Bl -bullet -offset indent -compact
                     44: .It
1.6       freda      45: .Cm bbva_usa
                     46: .It
1.9       freda      47: .Cm capital_one_360
                     48: .It
1.4       schwarze   49: .Cm capital_one_credit
                     50: .It
                     51: .Cm chase_credit
                     52: .It
1.9       freda      53: .Cm etrade_ira
                     54: .It
1.4       schwarze   55: .Cm optum_hsa
1.6       freda      56: .It
                     57: .Cm sparkasse_camt
                     58: .It
                     59: .Cm wellsfargo
1.3       schwarze   60: .El
                     61: .Pp
                     62: and corresponds to an existing
1.8       freda      63: .Pa ./import/ Ns Ar accountname Ns Pa .txt
                     64: configuration file.
1.5       schwarze   65: .Ss Configuration file format
1.8       freda      66: Each configuration file contains rules
1.7       freda      67: used to import transactions from a financial institution.
1.5       schwarze   68: Like all
                     69: .Xr pta 1
                     70: input files, it is an
                     71: .Xr ascii 7
                     72: text file using strings of one or more space characters
                     73: as the field delimiter and using the hash character
                     74: .Pq Sq #
                     75: in the first column to mark lines as ignored.
                     76: .Pp
1.7       freda      77: The rules are as follows:
                     78: .Bl -tag -width Ds
                     79: .It Ic ACCOUNT Ar csv_account_number
                     80: The number in
                     81: .Xr pta-accounts 5
                     82: of the bank or credit card account this CSV file contains entries for.
                     83: This rule is required in every configuration file.
1.11      freda      84: .It Ic AMOUNT Oo Ar debit_column Oc Ar credit_column
                     85: The column numbers in the CSV file containing amounts to be
                     86: booked on the debit or credits side of the contra account
                     87: .Ar account_number ,
                     88: respectively.
                     89: If
                     90: .Ar debit_column
                     91: is omitted, amounts preceded by a minus sign or enclosed
                     92: in parentheses are booked to the debit side.
1.10      freda      93: .It Ic COSTCENTER Ar costcenter_column
                     94: The column number in the CSV file containing the cost center.
                     95: Numbering starts from 1.
                     96: If this rule is not specified, no cost centers are assigned.
                     97: .It Ic DATE Ar date_column date_format
                     98: The column number in the CSV file containing the date.
                     99: Numbering starts from 1.
                    100: The
                    101: .Ar date_format
                    102: is one of
                    103: .Ic MM/DD/YY ,
                    104: .Ic MM/DD/YYYY ,
                    105: .Ic YYYY-MM-DD ,
                    106: or
                    107: .Ic DD.MM.YY .
                    108: This rule is required in every configuration file.
1.11      freda     109: .It Ic DESCRIPTION Ar descr_column ...
                    110: The column numbers in the CSV file to be concatenated to form the
                    111: text string for the journal entry.
                    112: Numbering starts from 1.
1.7       freda     113: .It Ic DELIM Ar delimiter
                    114: The character used to separate fields.
                    115: This rule is required in every configuration file.
                    116: Most financial institutions use commas but some use semicolons.
                    117: .It Ic HEADER Ar header
                    118: Skip the first line of the CSV file if it matches the
                    119: .Ar header
                    120: line verbatim, or cause parsing to fail if it does not.
                    121: .It Ic IGNORE Ar regular_expression
                    122: Skip all lines in the CSV file matching the
                    123: .Ar regular_expression .
1.10      freda     124: .It Ic QUANTITY Ar quantity_column
                    125: The column number in the CSV file containing the number of stock shares.
                    126: Numbering starts from 1.
                    127: If this rule is not specified, no information about the number of traded
                    128: securities is appended to the text string.
1.7       freda     129: .It Ic QUOTE Ar quote
                    130: Expects that every field starts and ends with the
                    131: .Ar quote
                    132: character.
                    133: .It Ar selector account_number booking_identifier
                    134: Lines in the CSV file that match the
1.5       schwarze  135: .Ar selector
1.7       freda     136: are associated with the contra account
1.5       schwarze  137: .Ar account_number
1.7       freda     138: and are assigned the
                    139: .Ar booking_identifier .
                    140: The selector is a string consisting of regular expressions separated
                    141: by delimiters defined in the
                    142: .Ic DELIM
                    143: rule.
                    144: .El
1.1       schwarze  145: .Sh FILES
1.12      freda     146: Example configuration files:
                    147: .Bl -tag -offset indent -width Ds -compact
1.8       freda     148: .It Pa ./import/bbva_usa.txt
1.9       freda     149: .It Pa ./import/capital_one_360.txt
1.8       freda     150: .It Pa ./import/capital_one_credit.txt
                    151: .It Pa ./import/chase_credit.txt
1.9       freda     152: .It Pa ./import/etrade_ira.txt
                    153: .It Pa ./import/optum_hsa.txt
1.8       freda     154: .It Pa ./import/sparkasse_camt.txt
                    155: .It Pa ./import/wellsfargo.txt
1.1       schwarze  156: .El
1.3       schwarze  157: .Pp
1.12      freda     158: Example CSV files:
                    159: .Bl -tag -offset indent -width Ds -compact
                    160: .It Pa ./csv/bbva_usa.csv
                    161: .It Pa ./csv/capital_one_360.csv
                    162: .It Pa ./csv/capital_one_credit.csv
                    163: .It Pa ./csv/chase_credit.csv
                    164: .It Pa ./csv/etrade_ira.csv
                    165: .It Pa ./csv/optum_hsa.csv
                    166: .It Pa ./csv/wellsfargo.csv
                    167: .El
1.1       schwarze  168: .Sh EXIT STATUS
                    169: .Ex -std
                    170: .Sh EXAMPLES
                    171: Add journal entries to a journal file using a CSV file generated by
1.13    ! freda     172: a financial institution, and a configuration file
        !           173: .Pa ./import/my_bank.txt :
1.1       schwarze  174: .Pp
1.13    ! freda     175: .Dl "$ pta_import -I my_bank downloaded.csv >> journal.txt"
1.1       schwarze  176: .Pp
1.13    ! freda     177: The result of applying a configuration file
        !           178: of the form
        !           179: .Pa ./import/accountname.txt
        !           180: to the corresponding CSV file
        !           181: .Pa ./csv/accountname.csv
        !           182: may be seen in
        !           183: .Pa ./regress/import/expected/accountname.out .
1.1       schwarze  184: .Sh SEE ALSO
                    185: .Xr pta-accounts 5 ,
                    186: .Xr pta-journal 5 ,
                    187: .Xr pta-glossary 7
                    188: .Sh BUGS
                    189: Currently,
                    190: .Nm
                    191: has the following limitations:
                    192: .Bl -dash
                    193: .It
1.3       schwarze  194: Pattern recognition in the
1.8       freda     195: .Pa import/accountname.txt
1.3       schwarze  196: files is under continued development.
                    197: .It
1.9       freda     198: User-defined configuration files are not currently
                    199: supported.
1.1       schwarze  200: .El

CVSweb