From 503a4bcdcc27c99e1248cbe84226b8ab56516378 Mon Sep 17 00:00:00 2001 From: Wyatt Pearsall Date: Thu, 29 Feb 2024 11:55:57 -0500 Subject: [PATCH] trim whitespace in ecfr --- .github/workflows/save-ecfr.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/save-ecfr.yml b/.github/workflows/save-ecfr.yml index d99de5d..8f16f58 100644 --- a/.github/workflows/save-ecfr.yml +++ b/.github/workflows/save-ecfr.yml @@ -35,7 +35,10 @@ jobs: IFS="," read -a BASH_PARTS <<< "$PARTS" for PART in "${BASH_PARTS[@]}"; do echo "$PART" - curl -sSL "https://www.ecfr.gov/api/renderer/v1/content/enhanced/${{ steps.date.outputs.value }}/title-12?chapter=X&part=${PART}" | htmlq -t '.part' | sed '/^$/d' > "./ecfr/${PART}.txt" + curl -sSL "https://www.ecfr.gov/api/renderer/v1/content/enhanced/${{ steps.date.outputs.value }}/title-12?chapter=X&part=${PART}" | + htmlq -t '.part' | + sed '/^ *$/d' | + awk '{$1=$1};1' > "./ecfr/${PART}.txt" done - name: Commit text