hledger Verified current stable Not installed? Data Processing

Hledger / Import Transactions From Single File

Import Transactions From Single File

Imports transactions from a specified single CSV file into hledger's journal.

$
Terminal
hledger import <path/to/bank.csv>

When To Use

During routine bank reconciliation tasks where a single file is involved.

Pro Tip

Utilize the `--dry-run` flag first to validate potential imports without writing to the journal.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
hledger import <path/to/bank.csv>

Anatomy of Output

Understanding the result

Processing CSV file: path/to/bank.csv File Status

Indicates the file being processed.

Imported 42 transactions, 5 errors Import Summary

Number of transactions successfully imported versus errors encountered.

Total Amount: $54.78 Balance Summary

Summary total calculated from imported transactions.

Troubleshooting

Common pitfalls

Error: File not found: path/to/bank.csv

Solution: Check the path and filename; ensure the file exists.

Error: Invalid CSV format

Solution: Ensure the CSV complies with expected delimiters and formats.

Error: Duplicate transaction detected

Solution: Check the file for duplicate entries before import.

Command Breakdown

What each part is doing

hledger
Base Command
The executable that performs this operation. Here it runs Hledger before the shell applies any redirect operators.
<path/to/bank.csv>
path to bank.csv
The value supplied for path to bank.csv.

Alternative Approaches

Comparable commands in other tools

Alternative data processing tools for the same job.