Created
January 25, 2023 01:59
-
-
Save lincerely/11d712417a793d8a89fa6c80cfc8b157 to your computer and use it in GitHub Desktop.
jq query for extracting raw text saved messages from Telegram desktop's exported JSON
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
| #!/usr/bin/env jq -r -f | |
| .chats.list[] | |
| | select(.type == "saved_messages") | |
| | .messages[] | |
| | select(.type == "message" and .text != "") | |
| | [.text_entities[].text] | join("") #combine text | |
| | gsub("\n"; "\\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment