=================================================================== RCS file: /cvs/pta/pta_import.1,v retrieving revision 1.5 retrieving revision 1.10 diff -u -p -r1.5 -r1.10 --- pta/pta_import.1 2020/11/14 22:15:56 1.5 +++ pta/pta_import.1 2020/11/30 16:19:19 1.10 @@ -1,4 +1,4 @@ -.\" $Id: pta_import.1,v 1.5 2020/11/14 22:15:56 schwarze Exp $ +.\" $Id: pta_import.1,v 1.10 2020/11/30 16:19:19 freda Exp $ .\" .\" Copyright (c) 2020 Freda Bundchen .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: November 14 2020 $ +.Dd $Mdocdate: November 30 2020 $ .Dt PTA_IMPORT 1 .Os .Sh NAME @@ -42,21 +42,29 @@ is exactly one of .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 -configuration file in the current directory. +.Pa ./import/ Ns Ar accountname Ns Pa .txt +configuration file. .Ss Configuration file format -Each file of the form -.Pa import_ Ns Ar accountname Ns Pa .txt -in the current directory is a configuration file used to -import transactions from a financial institution. +Each configuration file contains rules +used to import transactions from a financial institution. Like all .Xr pta 1 input files, it is an @@ -66,37 +74,71 @@ as the field delimiter and using the hash character .Pq Sq # in the first column to mark lines as ignored. .Pp -Each file contains one line beginning with -.Qq ACCOUNT -and is followed by whitespace and then an account number. -.Pp -Each file contains lines of the form -.Pp -.Ar selector account_number booking_identifier -.Pp +The rules are as follows: +.Bl -tag -width Ds +.It Ic ACCOUNT Ar csv_account_number +The number in +.Xr pta-accounts 5 +of the bank or credit card account this CSV file contains entries for. +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 DELIM Ar delimiter +The character used to separate fields. +This rule is required in every configuration file. +Most financial institutions use commas but some use semicolons. +.It Ic HEADER Ar header +Skip the first line of the CSV file if it matches the +.Ar header +line verbatim, or cause parsing to fail if it does not. +.It Ic IGNORE Ar regular_expression +Skip all lines in the CSV file matching the +.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 +Expects that every field starts and ends with the +.Ar quote +character. +.It Ar selector account_number booking_identifier +Lines in the CSV file that match the .Ar selector -is a string consisting of regular expressions -separated by commas. -Its fields correspond to header fields in the financial -institution's CSV file and is used to classify transactions -that match the search pattern. -The first selector that -matches a transaction wins. -.Pp -The +are associated with the contra account .Ar account_number -corresponds to an account number in -.Pa ./accounts.txt . -The -.Ar booking_identifier -is defined by the user to classify -the transaction. +and are assigned the +.Ar booking_identifier . +The selector is a string consisting of regular expressions separated +by delimiters defined in the +.Ic DELIM +rule. +.El .Sh FILES .Bl -tag -width Ds -compact -.It Pa ./import_capital_one_credit.txt -.It Pa ./import_chase_credit.txt -.It Pa ./import_optum_hsa.txt +.It Pa ./import/bbva_usa.txt +.It Pa ./import/capital_one_360.txt +.It Pa ./import/capital_one_credit.txt +.It Pa ./import/chase_credit.txt +.It Pa ./import/etrade_ira.txt +.It Pa ./import/optum_hsa.txt +.It Pa ./import/sparkasse_camt.txt +.It Pa ./import/wellsfargo.txt .El .Pp These files contain the header that the financial institution uses, the @@ -136,7 +178,7 @@ Suppose .Dl ,,,Automotive,,, 1111 AUTO .Pp is a sample entry in the -.Pa ./import_chase_credit.txt +.Pa ./import/chase_credit.txt file which uses headers of the form .Pp .Dl Transaction Date,Post Date,Description,Category,Type,Amount @@ -161,7 +203,7 @@ file contains .Dl "10/26/2020,10/26/2020,example.com*asldfkj,Shopping,Sale,-17.07" .Pp and -.Pa ./import_chase_credit.txt +.Pa ./import/chase_credit.txt contains .Bd -literal -offset Ds ACCOUNT 3234 @@ -216,7 +258,7 @@ Transaction Date,Post Date,Description,Category,Type,A .Ed .Pp and -.Pa ./import_chase_credit.txt +.Pa ./import/chase_credit.txt is given by .Bd -literal # Chase credit card header is @@ -272,9 +314,9 @@ has the following limitations: .Bl -dash .It Pattern recognition in the -.Pa import_accountname.txt +.Pa import/accountname.txt files is under continued development. .It -The only defined import formats are for Chase credit cards, -Capital One credit cards, and Optum Health Savings Accounts. +User-defined configuration files are not currently +supported. .El