Created
April 24, 2025 11:42
-
-
Save xamgore/0ecc183dce4fa218917fc9acad4c0931 to your computer and use it in GitHub Desktop.
Extract all the text messages from the telegram excerpt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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