# hledger CSV rules for hledger-csv-import-credit-card.csv # Utilly test file: a fictional September 2026 credit card statement, 21 transactions. # Guide: https://getutilly.com/guides/hledger-import-csv # Save this file next to the CSV, named like the CSV with .rules added. # the CSV has one header line (Date,Description,Amount) skip 1 # the three CSV columns, in order, become hledger's date, description and amount fields date, description, amount # the dates are month first, like 09/01/2026 date-format %m/%d/%Y # the amounts have no currency symbol, so add one currency $ # the card is a liability: charges are negative (more owed), payments and returns positive account1 liabilities:credit card # Unmatched lines go to expenses:unknown (charges) or income:unknown (credits). # These rules pick a better account by matching text in the line: if PAYMENT THANK YOU account2 assets:transfers if DELTA AIR|SOUTHWEST AIR|HILTON|UBER account2 expenses:travel if OFFICE DEPOT|FEDEX OFFICE|AMAZON account2 expenses:office if GOOGLE|ADOBE|ZOOM|LINKEDIN|CANVA account2 expenses:software if TACO DELI|STARBUCKS|WHOLE FOODS account2 expenses:meals if SHELL OIL account2 expenses:fuel if INTEREST CHARGE account2 expenses:interest