Dev.to WebDev πŸ›  Dev πŸ‘ 0 πŸ“– 3 min read

Why Parsing US Bank CSVs and Parliamentary Quorum Math Are Harder Than They Look (Two Zero-Dependency JS Libraries)

Two unglamorous problems waste thousands of hours every January: cleaning messy bank exports for tax prep and verifying quorum & motion vote thresholds during annual board, HOA, and shareholder meetings. Both look trivi

Two unglamorous problems waste thousands of hours every January: cleaning messy bank exports for tax prep and verifying quorum & motion vote thresholds during annual board, HOA, and shareholder meetings.

Both look trivial on paper ("just split by comma!" / "just divide by two!"), and both break constantly in production because of real-world legacy quirks. Today I open-sourced two zero-dependency ES module utilitiesβ€”bank-statement-xlsx-js and quorum-vote-calc-jsβ€”alongside free browser-local web tools that run 100% client-side with zero uploads.

Part 1: Four Real-World US Bank CSV Quirks That Break Naive Parsers

If you build bookkeeping toolsβ€”or just double-click a bank CSV in Excel before tax seasonβ€”you immediately hit four classic format traps:

  1. Chase Checking puts Details before Description: Chase's header starts with Details,Posting Date,Description,Amount,... where Details only says DEBIT or CREDIT. A naive column detector checking aliases.some(...) in column order grabs column 0 (Details) instead of column 2 (Description). Matching header aliases in priority order (description before details) eliminates the bug cleanly.
  2. Bank of America prepends 5–6 summary rows: Raw BofA CSVs begin with Beginning balance, Total credits, Total debits, and a blank row before the actual Date,Description,Amount,Running Bal. header. Scanning the first 20 non-empty rows for a valid header signature lets users drop unmodified exports straight from the portal.
  3. Wells Fargo ships completely headerless CSVs: Comma-delimited downloads start immediately on row 1 with "01/04/2026","-128.40","*","","AWS CLOUD SERVICES". Detecting a valid date in column 0 and monetary value in column 1 lets a parser synthesize column labels automatically.
  4. American Express flips credit card signs: Amex exports purchases as positive (+128.40) and payments/refunds as negative (-605.85)β€”the opposite of checking accounts. Adding an explicit invertSigns flag turns Amex exports into consistent Debits and Credits without spreadsheet gymnastics.
  5. Formula injection: Any merchant memo starting with =, +, -, or @ should be escaped with a leading apostrophe before writing .csv or .xlsx cells.

Part 2: Three Parliamentary Quorum & Vote Math Traps in Corporate/HOA Software

Every annual-meeting season, secretaries and developers stumble on three subtle math distinctions under Robert's Rules of Order and corporate statutes:

  1. Simple majority (> 50%) on an even board: For a 10-seat board, 5 is half, not a majority. Simple majority is strictly Math.floor(n / 2) + 1 = 6.
  2. Abstentions flip outcomes depending on two words in the bylaws:
    • Under Robert's Rules default ("majority of votes cast"), a 5 Yes / 4 No / 2 Abstain vote passes (5 > 4, abstentions excluded).
    • Under "majority of members present", the denominator becomes 11 (5 + 4 + 2), requiring 6 Yes votesβ€”so the exact same 5 / 4 / 2 vote fails, and every abstention acts like a No vote.
  3. Shareholder quorum is weighted by outstanding voting shares, not headcount: Treasury shares are excluded from the denominator, Delaware DGCL Β§216 sets a statutory floor of 1/3 (Math.ceil(shares / 3)), and broker non-votes typically count toward quorum only when a routine item appears on the ballot.

Both libraries run with node --test and zero npm dependencies. Pull requests for additional international bank CSV formats or state HOA quorum quirks are always welcome!

πŸ“° Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.