Last active
September 22, 2019 16:15
-
-
Save apraga/ed4155c84714d3b5eaabe641d26b6105 to your computer and use it in GitHub Desktop.
Importing Boursorama account into ledger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
tmp=tmp.csv | |
cp $1 $tmp | |
# Decimal notation | |
sed -i 's/,/\./g' $tmp | |
# Switch to comma | |
sed -i 's/;/,/g' $tmp | |
# Remove header | |
sed -i '1d' $tmp | |
# Add cutsom header | |
sed -i '1s/^/date,,description,,note,amount,,,code,,,\n/' $tmp | |
# Remove period in large numbers | |
sed -i 's/\([[:digit:]]\) \([[:digit:]]\+\)/\1\2/g' $tmp | |
opts="--input-date-format %d/%m/%Y -f ~/personal/comptes/comptes.dat --account Comptes:Boursorama --invert" | |
ledger convert $tmp $opts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment