hledger Verified current stable Not installed? Data Processing

Hledger / Show Transactions From Multiple Files Convert Costs

Show Transactions From Multiple Files Convert Costs

Generate transactions report from multiple journals, accounting for cost conversions.

$
Terminal
hledger print -f <path/to/2023.journal> -f <path/to/2024.journal> -B

When To Use

For comparative analysis across fiscal years and understanding cost impacts.

Pro Tip

Utilize --sort option for ordered output, aligning values with best accounting practices.

Anatomy of Output

Understanding the result

Date Description Amount Converted Cost Transaction Report

Ensures clarity on monetary flows.

2023-11-01 Asset A $10,000.00 $9,500.00 Transaction Record

Understanding cost basis versus market value.

2024-02-01 Asset B $15,000.00 $14,500.00 Transaction Record

Comparison highlights fiscal year impact.

Power User Variants

Optimized versions

hledger print -f path/to/2024.journal,path/to/2023.journal -B

Specify cost basis for transaction reporting.

hledger print --check-integrity -f path/to/journal

Perform checks for data integrity across journal files.

Troubleshooting

Common pitfalls

One or more journal files could not be opened.

Solution: Check file permissions for access.

Invalid flag combination detected.

Solution: Ensure that all flags are supported together.

Cannot convert costs due to missing data.

Solution: Ensure price and transaction data are correctly linked.

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.
-f
Input Files
The file path or paths supplied to this command.
<path/to/2023.journal>
path to 2023.journal
The value supplied for path to 2023.journal.
<path/to/2024.journal>
path to 2024.journal
The value supplied for path to 2024.journal.
-B
B| cost
The value supplied for B| cost.
-f
Command Option
Tool-specific option used by this command invocation.
-B
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.