This is a small command line tool to convert camt.052 from the Hamburger Sparkasse (Haspa) into csv.
Rust >= 1.7.0
You can either run the script with a .zip containing xml files:
$ cargo run -- ./testdata/camtPacket_1xxxxxxxxx_2018-01-01-2018-01-31.zip
Date;Valuta;Amount;Currency;Creditor;Debtor;Type;Description
2018-01-15;2018-01-15;-55.6;EUR;YYYYYYYY;Andreas Mausch Mausch;Lastschrift SEPA B2C;Blah blah blah
2018-01-15;2018-01-15;40;EUR;Andreas Mausch;Andreas Mausch;SEPA Gutschrift;Überweisung
2018-01-15;2018-01-15;-200;EUR;;Andreas Mausch;Barauszahlung GA;GA-NR00000000 BLZ20050550 1 15.01/13.37UHR Haspa0000/>H
..or with a single xml file:
cargo run -- ./testdata/camt_1xxxxxxxxx_15.01.2018.xml
You can also output the transactions as a .ods file for LibreCalc / Excel:
cargo run -- ./testdata/camt_1xxxxxxxxx_15.01.2018.xml --format ods --output testdata/output.ods
The ods library I use spreadsheet_ods doesn't support negative red numbers, see this issue.
Commands to analyze the raw XML output of a .ods file:
unzip -p output.ods content.xml | xmllint --format -
unzip -p output.ods styles.xml | xmllint --format -
cargo test
rustup target list
rustup target add x86_64-pc-windows-gnu
sudo pacman -S mingw-w64-gcc
RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --target x86_64-pc-windows-gnu
wine ./target/x86_64-pc-windows-gnu/release/haspa-camt052-to-csv.exe
I am not exactly sure what this file format is, but I think it is used in Europe only.
See this German Wikipedia article.
I found some pdfs describing the file formats: