From ec804535c0c7f926005d83f6331ca8a2b439fda2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Sat, 29 Jul 2023 15:51:15 +0200 Subject: [PATCH] Work on better partials matching. --- fetch_fio.sh | 5 ++++- fetch_fio_fine.sh | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/fetch_fio.sh b/fetch_fio.sh index 09f2e65..0767c8d 100644 --- a/fetch_fio.sh +++ b/fetch_fio.sh @@ -25,6 +25,9 @@ # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # +# Not usable anymore, kept for reference +exit 0 + # REST API endpoint APIURI=https://www.fio.cz/ib_api/rest @@ -219,7 +222,7 @@ get_header_field() { # $1 - account number make_acc_header() { first="`first_acc_part $1`" - last="`last_acc_part $2`" + last="`last_acc_part $1`" firstfname="$BANK_DIR_PARTS/$first" lastfname="$BANK_DIR_PARTS/$last" make_acc_header_static "$firstfname" diff --git a/fetch_fio_fine.sh b/fetch_fio_fine.sh index ef67c8f..d6dbe05 100644 --- a/fetch_fio_fine.sh +++ b/fetch_fio_fine.sh @@ -236,7 +236,7 @@ first_acc_part() { accno="$1" ls "${BANK_DIR_PARTS}/" \ | grep "^$accno" \ - | grep '.csv$' \ + | grep '[-][0-9][0-9][0-9][0-9].csv$' \ | sort \ | head -n 1 } @@ -248,7 +248,7 @@ last_acc_part() { accno="$1" ls "${BANK_DIR_PARTS}/" \ | grep "^$accno" \ - | grep '.csv$' \ + | grep '[-][0-9][0-9][0-9][0-9].csv$' \ | sort -r \ | head -n 1 } @@ -261,7 +261,7 @@ all_but_first_parts() { first="`first_acc_part $1`" ls "${BANK_DIR_PARTS}/" \ | grep "^$accno" \ - | grep '.csv$' \ + | grep '[-][0-9][0-9][0-9][0-9].csv$' \ | sort \ | grep -v "$first" } @@ -288,7 +288,7 @@ get_header_field() { # $1 - account number make_acc_header() { first="`first_acc_part $1`" - last="`last_acc_part $2`" + last="`last_acc_part $1`" firstfname="$BANK_DIR_PARTS/$first" lastfname="$BANK_DIR_PARTS/$last" make_acc_header_static "$firstfname" @@ -301,7 +301,7 @@ make_acc_header() { } # -# Creates the complete merged account statement +# Creates the complete merged account statement from yearly partials # $1 - account number merge_acc() { make_acc_header "$1"