From 7143eb84d2feb1fa22fc8fb4e09070f82c27be8f Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Fri, 11 Oct 2024 09:57:14 +0200 Subject: [PATCH] bulk remove script --- scripts/removebulk.fish | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 scripts/removebulk.fish diff --git a/scripts/removebulk.fish b/scripts/removebulk.fish new file mode 100644 index 0000000..2088df8 --- /dev/null +++ b/scripts/removebulk.fish @@ -0,0 +1,19 @@ +#!usr/bin/env fish +set SET $argv[1] + + +# export and remove colors +serra cards --set $SET --min-count 2 --sort value | gsed 's/\x1B[@A-Z\\\]^_]\|\x1B\[[0-9:;<=>?]*[-!"#$%&'"'"'()*+,.\/]*[][\\@A-Z^_`a-z{|}~]//g' > $SET + +# edit +nvim $SET + +# remove formatting +cat $SET | gsed 's/^\* //' | gsed 's/x.*(/ /' | gsed 's/).*//' | grep -v "Total Value" > {$SET}.txt + +# delete everything from serra +for x in (cat {$SET}.txt) ; echo serra remove -c $x ; end + +# cleanup +rm $SET +rm {$SET}.txt