hledger Verified current stable Not installed? Data Processing

Hledger / Import Transactions From All Csv Files

Import Transactions From All Csv Files

Imports transactions from all CSV files in a specified directory using a defined rules file for processing.

$
Terminal
hledger import --rules-file <common.rules> *.csv

When To Use

When integrating comprehensive bank transaction histories from a directory for accountable financial reporting.

Pro Tip

Ensure that the rules file optimally fits the transaction patterns; improperly defined rules can yield inaccurate data entries.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
hledger import --rules-file <common.rules> *.csv

Anatomy of Output

Understanding the result

Importing from directory: *.csv File Status

Indicates that all CSV files in the directory are being processed.

Imported 120 transactions; 10 errors encountered Import Summary

Details on successful imports versus errors.

Total Amount Credited: $243.67 Balance Summary

Total computed based on all processed transactions.

Troubleshooting

Common pitfalls

Error: Rules file not found: common.rules

Solution: Check the path of the rules file; ensure it exists.

Error: No CSV files found in the directory

Solution: Ensure that `.csv` files are present in the current directory.

Error: Rules file syntax error

Solution: Examine the rules file for syntax issues and rectify.

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.
<common.rules>
common.rules
The value supplied for common.rules.
--rules-file
Command Option
Tool-specific option used by this command invocation.

Alternative Approaches

Comparable commands in other tools

Alternative data processing tools for the same job.