Last active
March 16, 2020 19:38
-
-
Save gitjeff05/6dd641ce5a80a049d9800185ee88c6c5 to your computer and use it in GitHub Desktop.
Remove cell outputs and execution_count with the addition/merge operator in jq
This file contains 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
local FILE | |
FILE=${1} | |
jq -r --indent 1 '. + { "cells": .cells | |
| map(. + | |
(if .cell_type == "code" then { "outputs": [], "execution_count": null } else {} end) | |
) }' "${FILE}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment