Created
June 9, 2023 09:22
-
-
Save mymindwentblvnk/0d43b1c4bc00fea3bd5308e28ba64fc7 to your computer and use it in GitHub Desktop.
Go over all files in a GCS bucket and find files, that are not valid 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
for file in $(gsutil -m ls -r gs://**/*.json); do | |
echo "Validating $file" | |
gsutil cat "$file" | jq > /dev/null | |
if [ $? -ne 0 ]; then | |
echo "Invalid: $file" > invalid_files.txt | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment