=================================================================== RCS file: /cvs/pta/pta_import.1,v retrieving revision 1.6 retrieving revision 1.7 diff -u -p -r1.6 -r1.7 --- pta/pta_import.1 2020/11/23 18:46:05 1.6 +++ pta/pta_import.1 2020/11/25 15:04:25 1.7 @@ -1,4 +1,4 @@ -.\" $Id: pta_import.1,v 1.6 2020/11/23 18:46:05 freda Exp $ +.\" $Id: pta_import.1,v 1.7 2020/11/25 15:04:25 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 23 2020 $ +.Dd $Mdocdate: November 25 2020 $ .Dt PTA_IMPORT 1 .Os .Sh NAME @@ -61,8 +61,8 @@ configuration file in the current directory. .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. +in the current directory is a configuration file that contains rules +used to import transactions from a financial institution. Like all .Xr pta 1 input files, it is an @@ -72,32 +72,40 @@ 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 +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 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 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_bbva_usa.txt