Last active
March 24, 2025 09:12
-
-
Save StephaneTrebel/275d3353427bb1fcea56d1075a3cb287 to your computer and use it in GitHub Desktop.
Easily delete blocks from an OFX file
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
#!/bin/bash | |
# I always have issues with parsing LEDGERBAL and AVAILBAL in OFX files | |
# So I use this simple loop (that could be even further simplified with a `find`) | |
# To remove these two blocks, since I don't actually use them. | |
# One convenient thing is that these two blocks are contiguous so I only need | |
# To have a regex for the start of the first one (LEDGERBAL) to the end | |
# of the second one (AVAILBAL) | |
for file in $(ls input/*.ofx); | |
do | |
sed -i '/LEDGERBAL/,/\/AVAILBAL/d' $file | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment