container: hledger-flow: electrum: add uniform quotes

- Allows undesirable characters in variable-text columns
- Related refactoring
This commit is contained in:
2026-02-13 11:05:13 -08:00
parent 8efbec30cd
commit 3764376bfa

View File

@@ -2,7 +2,7 @@
# docker-finance | modern accounting for the power-user
#
# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
# Copyright (C) 2021-2026 Aaron Fiore (Founder, Evergreen Crypto LLC)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -39,7 +39,9 @@ function parse_without-lightning-header()
{
lib_preprocess::assert_header "transaction_hash,label,confirmations,value,fiat_value,fee,fiat_fee,timestamp"
gawk -v global_year="$global_year" -v global_subaccount="$global_subaccount" \
gawk --csv \
-v global_year="$global_year" \
-v global_subaccount="$global_subaccount" \
'{
if (NR<2 || $8 !~ global_year)
next
@@ -61,7 +63,7 @@ function parse_without-lightning-header()
#
sub(/%/, "%%", $2)
printf $2 OFS
printf "\""; printf $2; printf "\"" OFS
#
# confirmations
@@ -128,7 +130,7 @@ function parse_without-lightning-header()
printf "\n"
}' FS=, OFS=, "$global_in_path" >"$global_out_path"
}' OFS=, "$global_in_path" >"$global_out_path"
}
# Since electrum 4.6.2
@@ -137,7 +139,9 @@ function parse_with-lightning-header()
{
lib_preprocess::assert_header "oc_transaction_hash,ln_payment_hash,label,confirmations,amount_chain_bc,amount_lightning_bc,fiat_value,network_fee_satoshi,fiat_fee,timestamp"
gawk -v global_year="$global_year" -v global_subaccount="$global_subaccount" \
gawk --csv \
-v global_year="$global_year" \
-v global_subaccount="$global_subaccount" \
'{
if (NR<2 || $10 !~ global_year)
next
@@ -159,7 +163,7 @@ function parse_with-lightning-header()
#
sub(/%/, "%%", $3)
printf $3 OFS
print "\""; printf $3; printf "\"" OFS
#
# confirmations
@@ -254,7 +258,7 @@ function parse_with-lightning-header()
printf "\n"
}' FS=, OFS=, "$global_in_path" >"$global_out_path"
}' OFS=, "$global_in_path" >"$global_out_path"
}
function main()