Sharing your after-exporting JQ command here
You can share your jq command used after exporting here. I think pasting all the jq command to one issue is better for searching, for some newbies like me. I run the jq command below in Unix shell (macOS, etc) and it works, inspired by @ocean https://github.com/omnivore-app/omnivore/issues/4461#issuecomment-2453673588. But I cannot make this jq works in Windows. If you've done it, come on and share it here for others. How to export: https://docs.omnivore.app/using/exporting.html Below is the original post.
This is a jq command with a little fine-tune for converting to.xlsx format and .md format, and I add links to local files by =HYPERLINK() command.
Tips: The jq command can directly run in Unix shell such like macOS terminal, but it cannot directly work in windows cause the “quote problem”. You can fine-tune it and give it a try, check: https://jqlang.github.io/jq/manual/
Follow these steps to .xlsx (in macOS):
- Follow these official steps. Download your Omnivore ZIP. Unzip it.
- Enter the folder, right click the folder name on the bottom bar, choose “open in terminal”.
- Paste these code in the terminal and press enter.
jq -r '
(["Tags","Title","Description","Created","File","URL"]),
(.[] | [
([.labels[]?]|join(",")),
(.title | gsub("\\n";" ") | gsub("\\r";" ") | gsub("\"";"''") | gsub("[^[:print:]]";" ") | gsub("\\s+";" ")),
(.description | gsub("\\n";" ") | gsub("\\r";" ") | gsub("\"";"''") | gsub("[^[:print:]]";" ") | gsub("\\s+";" ")),
.savedAt,
("=HYPERLINK(G1&\"\\content\\" + .slug + ".html\" ,\"Open\")"),
.url
]) | @csv
' metadata_*.json > omnivore-export.csv- You should see the
omnivore-export.csvfile appears in the same folder. Open it withNumbersApp. - In
Numbers’s menu, click "Files > Export As > Excel…" , next step, export. - You should see the
omnivore-export.xlsxfile appears in the same folder. - Transport the folder to a windows PC. Open the
.xlsxwithExcel. - Copy the folder path in windows, and paste it to the
G2cell in Excel. - Now click a random "Open" button in column
E, you should open a local html file.
PS. I cannot make the links in .xlsx work in macOS, but they work in windows, you can give it a try.
Eventually, it looks like this, I covered the text, notice G2 and column E:
And here’s a version for Markdown .md. Get the .csv file and drop it to an online converter like this. Markdown softwares are slow at so much data though.
jq -r '
(["Tags","Title","Description","Created","File","URL"]),
(.[] | [
([.labels[]?]|join(",")),
(.title | gsub("\\n";" ") | gsub("\\r";" ") | gsub("\"";"''") | gsub("[^[:print:]]";" ") | gsub("\\s+";" ")),
(.description | gsub("\\n";" ") | gsub("\\r";" ") | gsub("\"";"''") | gsub("[^[:print:]]";" ") | gsub("\\s+";" ")),
.savedAt,
("[Open](.\\content\\" + .slug + ".html)"),
.url
]) | @csv
' metadata_*.json > omnivore-export.csvSource: omnivore-app/omnivore