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

Annotation of pta/pta_import.1, Revision 1.14

1.14    ! freda       1: .\" $Id: pta_import.1,v 1.13 2020/12/03 14:46:44 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.14    ! freda      40: The
1.5       schwarze   41: .Ar accountname
1.14    ! freda      42: argument corresponds to an existing
1.8       freda      43: .Pa ./import/ Ns Ar accountname Ns Pa .txt
                     44: configuration file.
1.5       schwarze   45: .Ss Configuration file format
1.8       freda      46: Each configuration file contains rules
1.7       freda      47: used to import transactions from a financial institution.
1.5       schwarze   48: Like all
                     49: .Xr pta 1
                     50: input files, it is an
                     51: .Xr ascii 7
                     52: text file using strings of one or more space characters
                     53: as the field delimiter and using the hash character
                     54: .Pq Sq #
                     55: in the first column to mark lines as ignored.
                     56: .Pp
1.7       freda      57: The rules are as follows:
                     58: .Bl -tag -width Ds
                     59: .It Ic ACCOUNT Ar csv_account_number
                     60: The number in
                     61: .Xr pta-accounts 5
                     62: of the bank or credit card account this CSV file contains entries for.
                     63: This rule is required in every configuration file.
1.11      freda      64: .It Ic AMOUNT Oo Ar debit_column Oc Ar credit_column
                     65: The column numbers in the CSV file containing amounts to be
                     66: booked on the debit or credits side of the contra account
                     67: .Ar account_number ,
                     68: respectively.
                     69: If
                     70: .Ar debit_column
                     71: is omitted, amounts preceded by a minus sign or enclosed
                     72: in parentheses are booked to the debit side.
1.10      freda      73: .It Ic COSTCENTER Ar costcenter_column
                     74: The column number in the CSV file containing the cost center.
                     75: Numbering starts from 1.
                     76: If this rule is not specified, no cost centers are assigned.
                     77: .It Ic DATE Ar date_column date_format
                     78: The column number in the CSV file containing the date.
                     79: Numbering starts from 1.
                     80: The
                     81: .Ar date_format
                     82: is one of
                     83: .Ic MM/DD/YY ,
                     84: .Ic MM/DD/YYYY ,
                     85: .Ic YYYY-MM-DD ,
                     86: or
                     87: .Ic DD.MM.YY .
                     88: This rule is required in every configuration file.
1.11      freda      89: .It Ic DESCRIPTION Ar descr_column ...
                     90: The column numbers in the CSV file to be concatenated to form the
                     91: text string for the journal entry.
                     92: Numbering starts from 1.
1.7       freda      93: .It Ic DELIM Ar delimiter
                     94: The character used to separate fields.
                     95: This rule is required in every configuration file.
                     96: Most financial institutions use commas but some use semicolons.
                     97: .It Ic HEADER Ar header
                     98: Skip the first line of the CSV file if it matches the
                     99: .Ar header
                    100: line verbatim, or cause parsing to fail if it does not.
                    101: .It Ic IGNORE Ar regular_expression
                    102: Skip all lines in the CSV file matching the
                    103: .Ar regular_expression .
1.10      freda     104: .It Ic QUANTITY Ar quantity_column
                    105: The column number in the CSV file containing the number of stock shares.
                    106: Numbering starts from 1.
                    107: If this rule is not specified, no information about the number of traded
                    108: securities is appended to the text string.
1.7       freda     109: .It Ic QUOTE Ar quote
                    110: Expects that every field starts and ends with the
                    111: .Ar quote
                    112: character.
                    113: .It Ar selector account_number booking_identifier
                    114: Lines in the CSV file that match the
1.5       schwarze  115: .Ar selector
1.7       freda     116: are associated with the contra account
1.5       schwarze  117: .Ar account_number
1.7       freda     118: and are assigned the
                    119: .Ar booking_identifier .
                    120: The selector is a string consisting of regular expressions separated
                    121: by delimiters defined in the
                    122: .Ic DELIM
                    123: rule.
                    124: .El
1.1       schwarze  125: .Sh FILES
1.12      freda     126: Example configuration files:
                    127: .Bl -tag -offset indent -width Ds -compact
1.8       freda     128: .It Pa ./import/bbva_usa.txt
1.9       freda     129: .It Pa ./import/capital_one_360.txt
1.8       freda     130: .It Pa ./import/capital_one_credit.txt
                    131: .It Pa ./import/chase_credit.txt
1.9       freda     132: .It Pa ./import/etrade_ira.txt
                    133: .It Pa ./import/optum_hsa.txt
1.8       freda     134: .It Pa ./import/sparkasse_camt.txt
                    135: .It Pa ./import/wellsfargo.txt
1.1       schwarze  136: .El
1.3       schwarze  137: .Pp
1.12      freda     138: Example CSV files:
                    139: .Bl -tag -offset indent -width Ds -compact
                    140: .It Pa ./csv/bbva_usa.csv
                    141: .It Pa ./csv/capital_one_360.csv
                    142: .It Pa ./csv/capital_one_credit.csv
                    143: .It Pa ./csv/chase_credit.csv
                    144: .It Pa ./csv/etrade_ira.csv
                    145: .It Pa ./csv/optum_hsa.csv
                    146: .It Pa ./csv/wellsfargo.csv
                    147: .El
1.1       schwarze  148: .Sh EXIT STATUS
                    149: .Ex -std
                    150: .Sh EXAMPLES
                    151: Add journal entries to a journal file using a CSV file generated by
1.13      freda     152: a financial institution, and a configuration file
                    153: .Pa ./import/my_bank.txt :
1.1       schwarze  154: .Pp
1.13      freda     155: .Dl "$ pta_import -I my_bank downloaded.csv >> journal.txt"
1.1       schwarze  156: .Pp
1.13      freda     157: The result of applying a configuration file
                    158: of the form
                    159: .Pa ./import/accountname.txt
                    160: to the corresponding CSV file
                    161: .Pa ./csv/accountname.csv
                    162: may be seen in
                    163: .Pa ./regress/import/expected/accountname.out .
1.1       schwarze  164: .Sh SEE ALSO
                    165: .Xr pta-accounts 5 ,
                    166: .Xr pta-journal 5 ,
                    167: .Xr pta-glossary 7
                    168: .Sh BUGS
                    169: Currently,
                    170: .Nm
                    171: has the following limitations:
                    172: .Bl -dash
                    173: .It
1.3       schwarze  174: Pattern recognition in the
1.8       freda     175: .Pa import/accountname.txt
1.3       schwarze  176: files is under continued development.
1.1       schwarze  177: .El

CVSweb