Skip to content

Instantly share code, notes, and snippets.

@Kapott
Created November 19, 2021 08:22
Show Gist options
  • Save Kapott/f3b2b350573a0bb4b7385e0f0e19e63c to your computer and use it in GitHub Desktop.
Save Kapott/f3b2b350573a0bb4b7385e0f0e19e63c to your computer and use it in GitHub Desktop.
# When exporting data from ABN Amro, they use their own MT940 format, incompatible with things like GnuCash.
# This shellscript takes in a file, and exports it with the suffix "_fixed"
#!/usr/bin/env bash
if test -e "$1"; then
grep -vE '^ABNANL2A\s$|^940\s$' "${1}" > "${1/\.STA/_fixed\.STA}"
echo "Written: ${1/\.STA/_fixed\.STA}"
else
echo "Usage: $0 <filename>"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment