Skip to content

Instantly share code, notes, and snippets.

@xamgore
Created April 24, 2025 11:42
Show Gist options
  • Save xamgore/0ecc183dce4fa218917fc9acad4c0931 to your computer and use it in GitHub Desktop.
Save xamgore/0ecc183dce4fa218917fc9acad4c0931 to your computer and use it in GitHub Desktop.
Extract all the text messages from the telegram excerpt
cat result.json | jq '.messages[] | .text' | jq -r '
# if the file is an array, map each element to either its .text or itself,
# then join them all into one string; otherwise just output the string
if type == "array" then
map(.text? // .) | join("")
else
.
end
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment