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

Diff for /pta/pta_import.1 between version 1.9 and 1.16

version 1.9, 2020/11/28 15:10:36 version 1.16, 2020/12/11 20:12:02
Line 37  If the
Line 37  If the
 .Ar file  .Ar file
 argument is omitted, standard input is read instead.  argument is omitted, standard input is read instead.
 .Pp  .Pp
   The
 .Ar accountname  .Ar accountname
 is exactly one of  argument corresponds to an existing
 .Pp  
 .Bl -bullet -offset indent -compact  
 .It  
 .Cm bbva_usa  
 .It  
 .Cm capital_one_360  
 .It  
 .Cm capital_one_credit  
 .It  
 .Cm chase_credit  
 .It  
 .Cm etrade_ira  
 .It  
 .Cm optum_hsa  
 .It  
 .Cm sparkasse_camt  
 .It  
 .Cm wellsfargo  
 .El  
 .Pp  
 and corresponds to an existing  
 .Pa ./import/ Ns Ar accountname Ns Pa .txt  .Pa ./import/ Ns Ar accountname Ns Pa .txt
 configuration file.  configuration file.
 .Ss Configuration file format  .Ss Configuration file format
Line 81  The number in
Line 61  The number in
 .Xr pta-accounts 5  .Xr pta-accounts 5
 of the bank or credit card account this CSV file contains entries for.  of the bank or credit card account this CSV file contains entries for.
 This rule is required in every configuration file.  This rule is required in every configuration file.
   .It Ic AMOUNT Oo Ar debit_column Oc Ar credit_column
   The column numbers in the CSV file containing amounts to be
   booked on the debit or credits side of the contra account
   .Ar account_number ,
   respectively.
   If
   .Ar debit_column
   is omitted, amounts preceded by a minus sign or enclosed
   in parentheses are booked to the debit side.
   This rule is required in every configuration file.
   .It Ic COSTCENTER Ar costcenter_column
   The column number in the CSV file containing the cost center.
   Numbering starts from 1.
   If this rule is not specified, no cost centers are assigned.
   .It Ic DATE Ar date_column date_format
   The column number in the CSV file containing the date.
   Numbering starts from 1.
   The
   .Ar date_format
   is one of
   .Ic MM/DD/YY ,
   .Ic MM/DD/YYYY ,
   .Ic YYYY-MM-DD ,
   or
   .Ic DD.MM.YY .
   This rule is required in every configuration file.
   .It Ic DESCRIPTION Ar descr_column ...
   The column numbers in the CSV file to be concatenated to form the
   text string for the journal entry.
   Numbering starts from 1.
   This rule is required in every configuration file.
 .It Ic DELIM Ar delimiter  .It Ic DELIM Ar delimiter
 The character used to separate fields.  The character used to separate fields.
 This rule is required in every configuration file.  
 Most financial institutions use commas but some use semicolons.  Most financial institutions use commas but some use semicolons.
   This rule is required in every configuration file.
 .It Ic HEADER Ar header  .It Ic HEADER Ar header
 Skip the first line of the CSV file if it matches the  Skip the first line of the CSV file if it matches the
 .Ar header  .Ar header
Line 92  line verbatim, or cause parsing to fail if it does not
Line 103  line verbatim, or cause parsing to fail if it does not
 .It Ic IGNORE Ar regular_expression  .It Ic IGNORE Ar regular_expression
 Skip all lines in the CSV file matching the  Skip all lines in the CSV file matching the
 .Ar regular_expression .  .Ar regular_expression .
   .It Ic QUANTITY Ar quantity_column
   The column number in the CSV file containing the number of stock shares.
   Numbering starts from 1.
   If this rule is not specified, no information about the number of traded
   securities is appended to the text string.
 .It Ic QUOTE Ar quote  .It Ic QUOTE Ar quote
 Expects that every field starts and ends with the  Expects that every field starts and ends with the
 .Ar quote  .Ar quote
Line 107  The selector is a string consisting of regular express
Line 123  The selector is a string consisting of regular express
 by delimiters defined in the  by delimiters defined in the
 .Ic DELIM  .Ic DELIM
 rule.  rule.
   These rules appear after all other rule types.
 .El  .El
 .Sh FILES  .Sh FILES
 .Bl -tag -width Ds -compact  Example configuration files:
   .Bl -tag -offset indent -width Ds -compact
 .It Pa ./import/bbva_usa.txt  .It Pa ./import/bbva_usa.txt
 .It Pa ./import/capital_one_360.txt  .It Pa ./import/capital_one_360.txt
 .It Pa ./import/capital_one_credit.txt  .It Pa ./import/capital_one_credit.txt
Line 120  rule.
Line 138  rule.
 .It Pa ./import/wellsfargo.txt  .It Pa ./import/wellsfargo.txt
 .El  .El
 .Pp  .Pp
 These files contain the header that the financial institution uses, the  Example CSV files:
 account number from  .Bl -tag -offset indent -width Ds -compact
 .Pa ./accounts.txt  .It Pa ./csv/bbva_usa.csv
 used by this account, as well as patterns used to map transactions to  .It Pa ./csv/capital_one_360.csv
 the correct account and booking identifier.  .It Pa ./csv/capital_one_credit.csv
   .It Pa ./csv/chase_credit.csv
   .It Pa ./csv/etrade_ira.csv
   .It Pa ./csv/optum_hsa.csv
   .It Pa ./csv/wellsfargo.csv
   .El
 .Sh EXIT STATUS  .Sh EXIT STATUS
 .Ex -std  .Ex -std
 .Sh EXAMPLES  .Sh EXAMPLES
 Add journal entries to a journal file using a CSV file generated by  Add journal entries to a journal file using a CSV file generated by
 a financial institution:  a financial institution, and a configuration file
   .Pa ./import/my_bank.txt :
 .Pp  .Pp
 .Dl "$ pta_import -I chase_credit chasedownload.csv >> journal.txt"  .Dl "$ pta_import -I my_bank downloaded.csv >> journal.txt"
 .Ss Account numbers in the configuration file  
 The line  
 .Pp  .Pp
 .Dl ACCOUNT 3235  The result of applying a configuration file
 .Pp  of the form
 in the configuration file corresponds to a line such as  .Pa ./import/accountname.txt
 .Pp  to the corresponding CSV file
 .Dl 3235 L Capital One credit card  .Pa ./csv/accountname.csv
 .Pp  may be seen in
 in  .Pa ./regress/import/expected/accountname.out .
 .Pa ./accounts.txt .  
 .Pp  
 The description  
 .Qq Capital One credit card  
 may vary, but in this example, the account numbers  
 .Qq 3235  
 match, and the account type is  
 .Qq L  
 to indicate that it is a liability account.  
 .Ss Patterns in the configuration file  
 Suppose  
 .Pp  
 .Dl ,,,Automotive,,, 1111 AUTO  
 .Pp  
 is a sample entry in the  
 .Pa ./import/chase_credit.txt  
 file which uses headers of the form  
 .Pp  
 .Dl Transaction Date,Post Date,Description,Category,Type,Amount  
 .Pp  
 Then this  
 .Ar selector  
 ignores the transaction date, post date, description, type, and amount.  
 It matches the  
 .Qq Automotive  
 category and maps transactions to account  
 .Qq 1111  
 defined in  
 .Pa ./accounts.txt  
 with the  
 .Qq Auto  
 booking identifier.  
 .Ss A sample credit card purchase  
 If  
 .Pa chasedownload.csv  
 file contains  
 .Pp  
 .Dl "10/26/2020,10/26/2020,example.com*asldfkj,Shopping,Sale,-17.07"  
 .Pp  
 and  
 .Pa ./import/chase_credit.txt  
 contains  
 .Bd -literal -offset Ds  
 ACCOUNT 3234  
 ,,,Shopping,,, 9996 SHOP  
 .Ed  
 .Pp  
 and  
 .Pa ./accounts.txt  
 contains  
 .Bd -literal -offset Ds  
 3234 L Chase credit card  
 9996 X shopping  
 .Ed  
 .Pp  
 then the  
 .Qq Shopping  
 category defined by Chase is mapped to the user's  
 .Qq SHOP  
 booking identifier, the user's account for shopping  
 expenses is defined as  
 .Qq 9996  
 in their  
 .Pa ./accounts.txt ,  
 the user's account for the credit card is 3234 in their  
 .Pa ./accounts.txt ,  
 and  
 .Nm  
 prints  
 .Pp  
 .Dl "20201026 SHOP 9996 3234 17.07 example.com*asldfkj"  
 .Ss A complete example  
 Suppose  
 .Pa ./accounts.txt  
 is given by  
 .Bd -literal  
 1700 A My Bank  
 3234 L My Chase Credit Card  
 5102 X Physician expenses  
 5103 X Dental expenses  
 5203 X Shopping  
 .Ed  
 .Pp  
 and  
 .Pa chasedownload.csv  
 is given by  
 .Bd -literal  
 Transaction Date,Post Date,Description,Category,Type,Amount,Memo  
 11/06/2020,11/09/2020,Dr. Joseph Schmoe,Health & Wellness,Sale,-100.00,  
 11/06/2020,11/09/2020,Dr. Sally Sue,Health & Wellness,Sale,-183.00,  
 11/08/2020,11/08/2020,example.com,Shopping,Sale,-53.83,  
 11/04/2020,11/04/2020,Payment Thank You - Web,,Payment,75.43,  
 .Ed  
 .Pp  
 and  
 .Pa ./import/chase_credit.txt  
 is given by  
 .Bd -literal  
 # Chase credit card header is  
 # Transaction Date,Post Date,Description,Category,Type,Amount  
 # The format of this file is  
 # selector account_number booking_identifier  
 # selector is a comma-separated list of regular expressions which  
 # matches corresponding fields in the CSV file  
 ACCOUNT 3234  
 ,,,Automotive,,, 1111 AUTO  
 ,,,Bills & Utilities,,, 2222 BILLS  
 ,,,Fees & Adjustments,,, 3333 FEES  
 ,,,Food & Drink,,, 4444 FOOD  
 ,,,Gas,,, 5555 GAS  
 ,,,Gifts & Donations,,, 6666 GIFTS  
 ,,,Groceries,,, 7777 GROCERIES  
 ,,Dr. Sally Sue,,,, 5103 DENTAL  
 ,,,Health & Wellness,,, 5102 PHYSICIAN  
 ,,,Home,,, 9999 HOME  
 ,,,Personal,,, 9998 PERSONAL  
 ,,,Professional Services,,, 9997 PRO  
 ,,,Shopping,,, 5203 SHOP  
 ,,,,Payment,, 1700 PAY  
 .Ed  
 .Pp  
 Then  
 .Pp  
 .Dl pta_import -I chase_credit chasedownload.csv  
 .Pp  
 outputs  
 .Bd -literal  
 20201109 PHYSICIAN 5102 3234 100.00 Dr. Joseph Schmoe  
 20201109 DENTAL 5103 3234 183.00 Dr. Sally Sue  
 20201108 SHOP 5203 3234 53.83 example.com  
 20201104 PAY 3234 1700 75.43 Payment Thank You - Web  
 .Ed  
 .Pp  
 Note that the selector for Dr\&. Sally Sue  
 in the example configuration file comes before the  
 Health & Wellness selector.  
 Since the first match wins, transactions for Dr\&. Sally Sue  
 can be classified with the DENTAL booking identifier,  
 even though the bank's CSV file classifies  
 these transactions as Health & Wellness.  
 .Sh SEE ALSO  .Sh SEE ALSO
   .Xr pta 1 ,
 .Xr pta-accounts 5 ,  .Xr pta-accounts 5 ,
 .Xr pta-journal 5 ,  .Xr pta-journal 5 ,
 .Xr pta-glossary 7  .Xr pta-glossary 7
Line 295  has the following limitations:
Line 178  has the following limitations:
 Pattern recognition in the  Pattern recognition in the
 .Pa import/accountname.txt  .Pa import/accountname.txt
 files is under continued development.  files is under continued development.
 .It  
 User-defined configuration files are not currently  
 supported.  
 .El  .El

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.16

CVSweb