Skip to content

Bank statements

Account, period and balance summary, and transactions read from a table whose Debit and Credit columns give each amount its sign.

input.txtHover a value to see its type · click it to find it in the treeRun in Studio
SAMPLE BANK STATEMENT
Cedar Valley Bank
Statement period: 9/25/2023-10/22/2023
Account: 004182337
Account holder: Little Oaks Child Care Center

Opening balance: $42,316.20
Money deposited: $58,940.75
Money withdrawn: $47,208.31
Closing balance: $54,048.64

Date       Description                   Reference    Debit       Credit
9/25/23    Check # 3105                  214          $1,280.00
9/25/23    Check # 3106                  215          $912.45
9/26/23    Northwest Payroll Services    216          $58.20
9/27/23    City Waste Services           217          $126.90
9/28/23    Office Supply Online          218          $342.18
9/29/23    Fresh Foods Market            219          $587.64
10/1/23    Transfer - credit card        220          $1,046.33
10/1/23    State Nutrition Program       221                      $3,875.10
bank-statements.ymlspec
# Bank statements: the bank, account, holder and period of a statement, its balance summary and its
# transactions. Consumers select nodes by type.
#
# Transactions come from a table whose header names its columns, where an unsigned amount under Debit or
# Credit takes its sign from the column, or from a line whose amounts carry their own sign. Slash dates
# are read month first.

$imports: [ 'values' ]

$flags: [ CASE_INSENSITIVE, MULTILINE ]

# The title of a statement, so that 'Your Bank Statement' is not read as a bank named 'Your Bank'.
StatementTitle: '(your|our|my|this) (bank |account )?statement'

Bank:
  $flags: [ -CASE_INSENSITIVE ]
  $local: { Word: "[A-Z][A-Za-z&'-]*" }
  # Cedar Valley Bank, First Harbor Credit Union, Northwind Savings Bank, Acme Bank, N.A.
  Named: '(${Word} )+(Bank|Credit Union|Trust Company)(,? N\.A\.)?'
  # Bank of Northshire
  BankOf: 'Bank of( the)?( ${Word})+'

AccountNumber:
  $local:
    Label: [ 'account', 'account number', 'account no\.?', 'account #', 'acct\.?', 'acct\.? #', 'acct\.? no\.?' ]
    Number: '[A-Za-z0-9*][A-Za-z0-9* -]*[0-9]'
  $fields: { number: Number }
  $patterns: '^${Label}:? *#{number} *$'

AccountHolder:
  $local:
    Label: [ 'account holder', 'account name', 'account owner', 'customer name', 'name on account', 'prepared for' ]
    Name: '\S([^\r\n]*\S)?'
  $fields: { name: Name }
  $patterns: '^${Label}:? +#{name} *$'

StatementPeriod:
  $local:
    Label: [ 'statement period', 'period', 'statement dates', 'for the period', 'period covered' ]
    Through: [ '-', '–', 'to', 'through', 'thru' ]
  $fields: { start: Date, end: Date }
  $patterns: '${Label}:?( from)? +#{start} *${Through} *#{end}'
  $value: { start: '#{start}', end: '#{end}' }

BalanceFigure:
  $local:
    Figure:
      Opening:
        $value: 'opening'
        $patterns:
          - '(opening|beginning|starting|previous) balance'
          - 'balance (brought )?forward'
      Deposits:
        $value: 'deposits'
        $patterns:
          - 'money deposited'
          - 'money in'
          - '(total )?deposits( and (other )?(credits|additions))?'
          - '(total )?credits'
          - 'paid in'
      Withdrawals:
        $value: 'withdrawals'
        $patterns:
          - 'money withdrawn'
          - 'money out'
          - '(total )?withdrawals( and (other )?(debits|subtractions))?'
          - '(total )?debits'
          - 'checks and (other )?debits'
          - 'paid out'
      Closing:
        $value: 'closing'
        $patterns:
          - '(closing|ending|new) balance'
          - 'balance carried forward'
    Count: '\d+'
    # spaces, tabs or dot leaders between the label and the amount
    Leader: '[ \t.]+'
  $fields: { figure: Figure, date: Date, count: Count, amount: Money }
  $patterns: '^#{figure}( (on|as of) #{date})?:?( *\(#{count}\))?${Leader}#{amount} *$'
  $value:
    figure: '#{figure}'
    date: '[#{date}]'
    count: '[#{count}]'
    amount: '#{amount.amount}'
    currency: '[#{amount.currency}]'

Transaction:
  $local:
    Description: '[^\r\n]+?'
    Reference: '[A-Za-z]*\d[A-Za-z0-9-]*'
    # spaces or tabs between columns
    Gap: '[ \t]+'
    DateHeader: 'Date'
    DescriptionHeader: [ 'Description', 'Details', 'Particulars' ]
    ReferenceHeader: [ 'Ref(erence)?', 'Check ?#' ]
    DebitHeader: [ 'Debit', 'Withdrawals?', 'Money out' ]
    CreditHeader: [ 'Credit', 'Deposits?', 'Money in' ]
    AmountHeader: 'Amount'
    BalanceHeader: 'Balance'
  $fields:
    date: Date
    description: Description
    reference: Reference
    debit: Money
    credit: Money
    amount: Money
    balance: Money
    amounts: { $type: 'Money[]', $separator: '${Gap}' }
  # A table whose header names its columns: an unsigned amount under Debit or Credit takes its sign
  # from its column; an amount under Amount carries its own sign.
  $tables:
    $columns:
      date: DateHeader
      description: DescriptionHeader
      reference: ReferenceHeader
      debit: DebitHeader
      credit: CreditHeader
      amount: AmountHeader
      balance: BalanceHeader
  # A line without such a header: the amounts carry their own sign.
  $patterns: '^#{date}${Gap}#{description}(${Gap}#{reference})?${Gap}#{amounts}[ \t]*$'
  $value:
    date: '#{date}'
    description: '#{description}'
    reference: '[#{reference}]'
    amount: '[-#{debit.amount}][#{credit.amount}][#{amount.amount}][#{amounts.0.amount}]'
    currency: '[#{debit.currency}][#{credit.currency}][#{amount.currency}][#{amounts.0.currency}]'
    balance: '[#{balance.amount}][#{amounts.1.amount}]'
$ texomy parse input.txt -m bank-statements
bank-statements.json
[
  {
    "type": "Bank::Named",
    "start": 22,
    "end": 39,
    "text": "Cedar Valley Bank"
  },
  {
    "type": "StatementPeriod",
    "start": 40,
    "end": 78,
    "fields": {
      "start": {
        "type": "Date::MonthDayYear",
        "start": 58,
        "end": 67,
        "fields": {
          "year": {
            "type": "Year::Full",
            "start": 63,
            "end": 67,
            "text": "2023"
          },
          "month": {
            "type": "MonthNumber::Single",
            "start": 58,
            "end": 59,
            "fields": {
              "digit": {
                "type": "Digit",
                "start": 58,
                "end": 59,
                "text": "9"
              }
            },
            "value": "09"
          },
          "day": {
            "type": "Day::Double",
            "start": 60,
            "end": 62,
            "text": "25"
          }
        },
        "value": "2023-09-25"
      },
      "end": {
        "type": "Date::MonthDayYear",
        "start": 68,
        "end": 78,
        "fields": {
          "year": {
            "type": "Year::Full",
            "start": 74,
            "end": 78,
            "text": "2023"
          },
          "month": {
            "type": "MonthNumber::Double",
            "start": 68,
            "end": 70,
            "text": "10"
          },
          "day": {
            "type": "Day::Double",
            "start": 71,
            "end": 73,
            "text": "22"
          }
        },
        "value": "2023-10-22"
      }
    },
    "value": {
      "start": "2023-09-25",
      "end": "2023-10-22"
    }
  },
  {
    "type": "AccountNumber",
    "start": 79,
    "end": 97,
    "fields": {
      "number": {
        "type": "Number",
        "start": 88,
        "end": 97,
        "text": "004182337"
      }
    }
  },
  {
    "type": "AccountHolder",
    "start": 98,
    "end": 143,
    "fields": {
      "name": {
        "type": "Name",
        "start": 114,
        "end": 143,
        "text": "Little Oaks Child Care Center"
      }
    }
  },
  {
    "type": "BalanceFigure",
    "start": 145,
    "end": 172,
    "fields": {
      "figure": {
        "type": "Figure::Opening",
        "start": 145,
        "end": 160,
        "text": "Opening balance",
        "value": "opening"
      },
      "amount": {
        "type": "Money::Positive",
        "start": 162,
        "end": 172,
        "fields": {
          "amount": {
            "type": "Amount",
            "start": 163,
            "end": 172,
            "fields": {
              "groups": [
                {
                  "type": "Group",
                  "start": 163,
                  "end": 165,
                  "text": "42"
                },
                {
                  "type": "Group",
                  "start": 166,
                  "end": 169,
                  "text": "316"
                }
              ],
              "fraction": {
                "type": "Fraction",
                "start": 170,
                "end": 172,
                "text": "20"
              }
            },
            "value": "42316.20"
          },
          "currency": {
            "type": "Currency::Usd",
            "start": 162,
            "end": 163,
            "text": "$",
            "value": "USD"
          }
        },
        "value": {
          "amount": "42316.20",
          "currency": "USD"
        }
      }
    },
    "value": {
      "figure": "opening",
      "date": null,
      "count": null,
      "amount": "42316.20",
      "currency": "USD"
    }
  },
  {
    "type": "BalanceFigure",
    "start": 173,
    "end": 200,
    "fields": {
      "figure": {
        "type": "Figure::Deposits",
        "start": 173,
        "end": 188,
        "text": "Money deposited",
        "value": "deposits"
      },
      "amount": {
        "type": "Money::Positive",
        "start": 190,
        "end": 200,
        "fields": {
          "amount": {
            "type": "Amount",
            "start": 191,
            "end": 200,
            "fields": {
              "groups": [
                {
                  "type": "Group",
                  "start": 191,
                  "end": 193,
                  "text": "58"
                },
                {
                  "type": "Group",
                  "start": 194,
                  "end": 197,
                  "text": "940"
                }
              ],
              "fraction": {
                "type": "Fraction",
                "start": 198,
                "end": 200,
                "text": "75"
              }
            },
            "value": "58940.75"
          },
          "currency": {
            "type": "Currency::Usd",
            "start": 190,
            "end": 191,
            "text": "$",
            "value": "USD"
          }
        },
        "value": {
          "amount": "58940.75",
          "currency": "USD"
        }
      }
    },
    "value": {
      "figure": "deposits",
      "date": null,
      "count": null,
      "amount": "58940.75",
      "currency": "USD"
    }
  },
  {
    "type": "BalanceFigure",
    "start": 201,
    "end": 228,
    "fields": {
      "figure": {
        "type": "Figure::Withdrawals",
        "start": 201,
        "end": 216,
        "text": "Money withdrawn",
        "value": "withdrawals"
      },
      "amount": {
        "type": "Money::Positive",
        "start": 218,
        "end": 228,
        "fields": {
          "amount": {
            "type": "Amount",
            "start": 219,
            "end": 228,
            "fields": {
              "groups": [
                {
                  "type": "Group",
                  "start": 219,
                  "end": 221,
                  "text": "47"
                },
                {
                  "type": "Group",
                  "start": 222,
                  "end": 225,
                  "text": "208"
                }
              ],
              "fraction": {
                "type": "Fraction",
                "start": 226,
                "end": 228,
                "text": "31"
              }
            },
            "value": "47208.31"
          },
          "currency": {
            "type": "Currency::Usd",
            "start": 218,
            "end": 219,
            "text": "$",
            "value": "USD"
          }
        },
        "value": {
          "amount": "47208.31",
          "currency": "USD"
        }
      }
    },
    "value": {
      "figure": "withdrawals",
      "date": null,
      "count": null,
      "amount": "47208.31",
      "currency": "USD"
    }
  },
  {
    "type": "BalanceFigure",
    "start": 229,
    "end": 256,
    "fields": {
      "figure": {
        "type": "Figure::Closing",
        "start": 229,
        "end": 244,
        "text": "Closing balance",
        "value": "closing"
      },
      "amount": {
        "type": "Money::Positive",
        "start": 246,
        "end": 256,
        "fields": {
          "amount": {
            "type": "Amount",
            "start": 247,
            "end": 256,
            "fields": {
              "groups": [
                {
                  "type": "Group",
                  "start": 247,
                  "end": 249,
                  "text": "54"
                },
                {
                  "type": "Group",
                  "start": 250,
                  "end": 253,
                  "text": "048"
                }
              ],
              "fraction": {
                "type": "Fraction",
                "start": 254,
                "end": 256,
                "text": "64"
              }
            },
            "value": "54048.64"
          },
          "currency": {
            "type": "Currency::Usd",
            "start": 246,
            "end": 247,
            "text": "$",
            "value": "USD"
          }
        },
        "value": {
          "amount": "54048.64",
          "currency": "USD"
        }
      }
    },
    "value": {
      "figure": "closing",
      "date": null,
      "count": null,
      "amount": "54048.64",
      "currency": "USD"
    }
  },
  {
    "type": "Transaction",
    "start": 331,
    "end": 394,
    "fields": {
      "date": {
        "type": "Date::MonthDayYear",
        "start": 331,
        "end": 338,
        "fields": {
          "year": {
            "type": "Year::Short",
            "start": 336,
            "end": 338,
            "fields": {
              "digits": {
                "type": "Digits",
                "start": 336,
                "end": 338,
                "text": "23"
              }
            },
            "value": "2023"
          },
          "month": {
            "type": "MonthNumber::Single",
            "start": 331,
            "end": 332,
            "fields": {
              "digit": {
                "type": "Digit",
                "start": 331,
                "end": 332,
                "text": "9"
              }
            },
            "value": "09"
          },
          "day": {
            "type": "Day::Double",
            "start": 333,
            "end": 335,
            "text": "25"
          }
        },
        "value": "2023-09-25"
      },
      "description": {
        "type": "Description",
        "start": 342,
        "end": 354,
        "text": "Check # 3105"
      },
      "reference": {
        "type": "Reference",
        "start": 372,
        "end": 375,
        "text": "214"
      },
      "debit": {
        "type": "Money::Positive",
        "start": 385,
        "end": 394,
        "fields": {
          "amount": {
            "type": "Amount",
            "start": 386,
            "end": 394,
            "fields": {
              "groups": [
                {
                  "type": "Group",
                  "start": 386,
                  "end": 387,
                  "text": "1"
                },
                {
                  "type": "Group",
                  "start": 388,
                  "end": 391,
                  "text": "280"
                }
              ],
              "fraction": {
                "type": "Fraction",
                "start": 392,
                "end": 394,
                "text": "00"
              }
            },
            "value": "1280.00"
          },
          "currency": {
            "type": "Currency::Usd",
            "start": 385,
            "end": 386,
            "text": "$",
            "value": "USD"
          }
        },
        "value": {
          "amount": "1280.00",
          "currency": "USD"
        }
      }
    },
    "value": {
      "date": "2023-09-25",
      "description": "Check # 3105",
      "reference": "214",
      "amount": "-1280.00",
      "currency": "USD",
      "balance": null
    }
  },
  {
    "type": "Transaction",
    "start": 395,
    "end": 456,
    "fields": {
      "date": {
        "type": "Date::MonthDayYear",
        "start": 395,
        "end": 402,
        "fields": {
          "year": {
            "type": "Year::Short",
            "start": 400,
            "end": 402,
            "fields": {
              "digits": {
                "type": "Digits",
                "start": 400,
                "end": 402,
                "text": "23"
              }
            },
            "value": "2023"
          },
          "month": {
            "type": "MonthNumber::Single",
            "start": 395,
            "end": 396,
            "fields": {
              "digit": {
                "type": "Digit",
                "start": 395,
                "end": 396,
                "text": "9"
              }
            },
            "value": "09"
          },
          "day": {
            "type": "Day::Double",
            "start": 397,
            "end": 399,
            "text": "25"
          }
        },
        "value": "2023-09-25"
      },
      "description": {
        "type": "Description",
        "start": 406,
        "end": 418,
        "text": "Check # 3106"
      },
      "reference": {
        "type": "Reference",
        "start": 436,
        "end": 439,
        "text": "215"
      },
      "debit": {
        "type": "Money::Positive",
        "start": 449,
        "end": 456,
        "fields": {
          "amount": {
            "type": "Amount",
            "start": 450,
            "end": 456,
            "fields": {
              "groups": [
                {
                  "type": "Group",
                  "start": 450,
                  "end": 453,
                  "text": "912"
                }
              ],
              "fraction": {
                "type": "Fraction",
                "start": 454,
                "end": 456,
                "text": "45"
              }
            },
            "value": "912.45"
          },
          "currency": {
            "type": "Currency::Usd",
            "start": 449,
            "end": 450,
            "text": "$",
            "value": "USD"
          }
        },
        "value": {
          "amount": "912.45",
          "currency": "USD"
        }
      }
    },
    "value": {
      "date": "2023-09-25",
      "description": "Check # 3106",
      "reference": "215",
      "amount": "-912.45",
      "currency": "USD",
      "balance": null
    }
  },
  {
    "type": "Transaction",
    "start": 457,
    "end": 517,
    "fields": {
      "date": {
        "type": "Date::MonthDayYear",
        "start": 457,
        "end": 464,
        "fields": {
          "year": {
            "type": "Year::Short",
            "start": 462,
            "end": 464,
            "fields": {
              "digits": {
                "type": "Digits",
                "start": 462,
                "end": 464,
                "text": "23"
              }
            },
            "value": "2023"
          },
          "month": {
            "type": "MonthNumber::Single",
            "start": 457,
            "end": 458,
            "fields": {
              "digit": {
                "type": "Digit",
                "start": 457,
                "end": 458,
                "text": "9"
              }
            },
            "value": "09"
          },
          "day": {
            "type": "Day::Double",
            "start": 459,
            "end": 461,
            "text": "26"
          }
        },
        "value": "2023-09-26"
      },
      "description": {
        "type": "Description",
        "start": 468,
        "end": 494,
        "text": "Northwest Payroll Services"
      },
      "reference": {
        "type": "Reference",
        "start": 498,
        "end": 501,
        "text": "216"
      },
      "debit": {
        "type": "Money::Positive",
        "start": 511,
        "end": 517,
        "fields": {
          "amount": {
            "type": "Amount",
            "start": 512,
            "end": 517,
            "fields": {
              "groups": [
                {
                  "type": "Group",
                  "start": 512,
                  "end": 514,
                  "text": "58"
                }
              ],
              "fraction": {
                "type": "Fraction",
                "start": 515,
                "end": 517,
                "text": "20"
              }
            },
            "value": "58.20"
          },
          "currency": {
            "type": "Currency::Usd",
            "start": 511,
            "end": 512,
            "text": "$",
            "value": "USD"
          }
        },
        "value": {
          "amount": "58.20",
          "currency": "USD"
        }
      }
    },
    "value": {
      "date": "2023-09-26",
      "description": "Northwest Payroll Services",
      "reference": "216",
      "amount": "-58.20",
      "currency": "USD",
      "balance": null
    }
  },
  {
    "type": "Transaction",
    "start": 518,
    "end": 579,
    "fields": {
      "date": {
        "type": "Date::MonthDayYear",
        "start": 518,
        "end": 525,
        "fields": {
          "year": {
            "type": "Year::Short",
            "start": 523,
            "end": 525,
            "fields": {
              "digits": {
                "type": "Digits",
                "start": 523,
                "end": 525,
                "text": "23"
              }
            },
            "value": "2023"
          },
          "month": {
            "type": "MonthNumber::Single",
            "start": 518,
            "end": 519,
            "fields": {
              "digit": {
                "type": "Digit",
                "start": 518,
                "end": 519,
                "text": "9"
              }
            },
            "value": "09"
          },
          "day": {
            "type": "Day::Double",
            "start": 520,
            "end": 522,
            "text": "27"
          }
        },
        "value": "2023-09-27"
      },
      "description": {
        "type": "Description",
        "start": 529,
        "end": 548,
        "text": "City Waste Services"
      },
      "reference": {
        "type": "Reference",
        "start": 559,
        "end": 562,
        "text": "217"
      },
      "debit": {
        "type": "Money::Positive",
        "start": 572,
        "end": 579,
        "fields": {
          "amount": {
            "type": "Amount",
            "start": 573,
            "end": 579,
            "fields": {
              "groups": [
                {
                  "type": "Group",
                  "start": 573,
                  "end": 576,
                  "text": "126"
                }
              ],
              "fraction": {
                "type": "Fraction",
                "start": 577,
                "end": 579,
                "text": "90"
              }
            },
            "value": "126.90"
          },
          "currency": {
            "type": "Currency::Usd",
            "start": 572,
            "end": 573,
            "text": "$",
            "value": "USD"
          }
        },
        "value": {
          "amount": "126.90",
          "currency": "USD"
        }
      }
    },
    "value": {
      "date": "2023-09-27",
      "description": "City Waste Services",
      "reference": "217",
      "amount": "-126.90",
      "currency": "USD",
      "balance": null
    }
  },
  {
    "type": "Transaction",
    "start": 580,
    "end": 641,
    "fields": {
      "date": {
        "type": "Date::MonthDayYear",
        "start": 580,
        "end": 587,
        "fields": {
          "year": {
            "type": "Year::Short",
            "start": 585,
            "end": 587,
            "fields": {
              "digits": {
                "type": "Digits",
                "start": 585,
                "end": 587,
                "text": "23"
              }
            },
            "value": "2023"
          },
          "month": {
            "type": "MonthNumber::Single",
            "start": 580,
            "end": 581,
            "fields": {
              "digit": {
                "type": "Digit",
                "start": 580,
                "end": 581,
                "text": "9"
              }
            },
            "value": "09"
          },
          "day": {
            "type": "Day::Double",
            "start": 582,
            "end": 584,
            "text": "28"
          }
        },
        "value": "2023-09-28"
      },
      "description": {
        "type": "Description",
        "start": 591,
        "end": 611,
        "text": "Office Supply Online"
      },
      "reference": {
        "type": "Reference",
        "start": 621,
        "end": 624,
        "text": "218"
      },
      "debit": {
        "type": "Money::Positive",
        "start": 634,
        "end": 641,
        "fields": {
          "amount": {
            "type": "Amount",
            "start": 635,
            "end": 641,
            "fields": {
              "groups": [
                {
                  "type": "Group",
                  "start": 635,
                  "end": 638,
                  "text": "342"
                }
              ],
              "fraction": {
                "type": "Fraction",
                "start": 639,
                "end": 641,
                "text": "18"
              }
            },
            "value": "342.18"
          },
          "currency": {
            "type": "Currency::Usd",
            "start": 634,
            "end": 635,
            "text": "$",
            "value": "USD"
          }
        },
        "value": {
          "amount": "342.18",
          "currency": "USD"
        }
      }
    },
    "value": {
      "date": "2023-09-28",
      "description": "Office Supply Online",
      "reference": "218",
      "amount": "-342.18",
      "currency": "USD",
      "balance": null
    }
  },
  {
    "type": "Transaction",
    "start": 642,
    "end": 703,
    "fields": {
      "date": {
        "type": "Date::MonthDayYear",
        "start": 642,
        "end": 649,
        "fields": {
          "year": {
            "type": "Year::Short",
            "start": 647,
            "end": 649,
            "fields": {
              "digits": {
                "type": "Digits",
                "start": 647,
                "end": 649,
                "text": "23"
              }
            },
            "value": "2023"
          },
          "month": {
            "type": "MonthNumber::Single",
            "start": 642,
            "end": 643,
            "fields": {
              "digit": {
                "type": "Digit",
                "start": 642,
                "end": 643,
                "text": "9"
              }
            },
            "value": "09"
          },
          "day": {
            "type": "Day::Double",
            "start": 644,
            "end": 646,
            "text": "29"
          }
        },
        "value": "2023-09-29"
      },
      "description": {
        "type": "Description",
        "start": 653,
        "end": 671,
        "text": "Fresh Foods Market"
      },
      "reference": {
        "type": "Reference",
        "start": 683,
        "end": 686,
        "text": "219"
      },
      "debit": {
        "type": "Money::Positive",
        "start": 696,
        "end": 703,
        "fields": {
          "amount": {
            "type": "Amount",
            "start": 697,
            "end": 703,
            "fields": {
              "groups": [
                {
                  "type": "Group",
                  "start": 697,
                  "end": 700,
                  "text": "587"
                }
              ],
              "fraction": {
                "type": "Fraction",
                "start": 701,
                "end": 703,
                "text": "64"
              }
            },
            "value": "587.64"
          },
          "currency": {
            "type": "Currency::Usd",
            "start": 696,
            "end": 697,
            "text": "$",
            "value": "USD"
          }
        },
        "value": {
          "amount": "587.64",
          "currency": "USD"
        }
      }
    },
    "value": {
      "date": "2023-09-29",
      "description": "Fresh Foods Market",
      "reference": "219",
      "amount": "-587.64",
      "currency": "USD",
      "balance": null
    }
  },
  {
    "type": "Transaction",
    "start": 704,
    "end": 767,
    "fields": {
      "date": {
        "type": "Date::MonthDayYear",
        "start": 704,
        "end": 711,
        "fields": {
          "year": {
            "type": "Year::Short",
            "start": 709,
            "end": 711,
            "fields": {
              "digits": {
                "type": "Digits",
                "start": 709,
                "end": 711,
                "text": "23"
              }
            },
            "value": "2023"
          },
          "month": {
            "type": "MonthNumber::Double",
            "start": 704,
            "end": 706,
            "text": "10"
          },
          "day": {
            "type": "Day::Single",
            "start": 707,
            "end": 708,
            "fields": {
              "digit": {
                "type": "Digit",
                "start": 707,
                "end": 708,
                "text": "1"
              }
            },
            "value": "01"
          }
        },
        "value": "2023-10-01"
      },
      "description": {
        "type": "Description",
        "start": 715,
        "end": 737,
        "text": "Transfer - credit card"
      },
      "reference": {
        "type": "Reference",
        "start": 745,
        "end": 748,
        "text": "220"
      },
      "debit": {
        "type": "Money::Positive",
        "start": 758,
        "end": 767,
        "fields": {
          "amount": {
            "type": "Amount",
            "start": 759,
            "end": 767,
            "fields": {
              "groups": [
                {
                  "type": "Group",
                  "start": 759,
                  "end": 760,
                  "text": "1"
                },
                {
                  "type": "Group",
                  "start": 761,
                  "end": 764,
                  "text": "046"
                }
              ],
              "fraction": {
                "type": "Fraction",
                "start": 765,
                "end": 767,
                "text": "33"
              }
            },
            "value": "1046.33"
          },
          "currency": {
            "type": "Currency::Usd",
            "start": 758,
            "end": 759,
            "text": "$",
            "value": "USD"
          }
        },
        "value": {
          "amount": "1046.33",
          "currency": "USD"
        }
      }
    },
    "value": {
      "date": "2023-10-01",
      "description": "Transfer - credit card",
      "reference": "220",
      "amount": "-1046.33",
      "currency": "USD",
      "balance": null
    }
  },
  {
    "type": "Transaction",
    "start": 768,
    "end": 843,
    "fields": {
      "date": {
        "type": "Date::MonthDayYear",
        "start": 768,
        "end": 775,
        "fields": {
          "year": {
            "type": "Year::Short",
            "start": 773,
            "end": 775,
            "fields": {
              "digits": {
                "type": "Digits",
                "start": 773,
                "end": 775,
                "text": "23"
              }
            },
            "value": "2023"
          },
          "month": {
            "type": "MonthNumber::Double",
            "start": 768,
            "end": 770,
            "text": "10"
          },
          "day": {
            "type": "Day::Single",
            "start": 771,
            "end": 772,
            "fields": {
              "digit": {
                "type": "Digit",
                "start": 771,
                "end": 772,
                "text": "1"
              }
            },
            "value": "01"
          }
        },
        "value": "2023-10-01"
      },
      "description": {
        "type": "Description",
        "start": 779,
        "end": 802,
        "text": "State Nutrition Program"
      },
      "reference": {
        "type": "Reference",
        "start": 809,
        "end": 812,
        "text": "221"
      },
      "credit": {
        "type": "Money::Positive",
        "start": 834,
        "end": 843,
        "fields": {
          "amount": {
            "type": "Amount",
            "start": 835,
            "end": 843,
            "fields": {
              "groups": [
                {
                  "type": "Group",
                  "start": 835,
                  "end": 836,
                  "text": "3"
                },
                {
                  "type": "Group",
                  "start": 837,
                  "end": 840,
                  "text": "875"
                }
              ],
              "fraction": {
                "type": "Fraction",
                "start": 841,
                "end": 843,
                "text": "10"
              }
            },
            "value": "3875.10"
          },
          "currency": {
            "type": "Currency::Usd",
            "start": 834,
            "end": 835,
            "text": "$",
            "value": "USD"
          }
        },
        "value": {
          "amount": "3875.10",
          "currency": "USD"
        }
      }
    },
    "value": {
      "date": "2023-10-01",
      "description": "State Nutrition Program",
      "reference": "221",
      "amount": "3875.10",
      "currency": "USD",
      "balance": null
    }
  }
]

About this spec

Bank statements: the bank, account, holder and period, the balance summary, and transactions from a table whose header names its columns or from lines whose amounts carry their sign.

Package files

  • bank-statements.yml
  • texomy.json
  • values.yml
  • samples/eu-savings.txt
  • samples/invoice-not-statement.txt
  • samples/uk-bank.txt
  • samples/us-credit-union.txt
  • tests/bank-statements.test.yml
  • tests/samples.test.yml
  • tests/values.test.yml

162 nodes from 16 top-level matches.

Run it yourself

Save the example from Studio to a folder, then in that folder:

texomy parse input.txt -m bank-statements
texomy test

Write the spec once. Run it on everything.

Install the CLI, connect your agent, and turn your first sample into typed data in minutes.

brew install texomy/tap/texomy