Skip to content

Instantly share code, notes, and snippets.

@comstock
Last active July 29, 2020 20:15
Show Gist options
  • Select an option

  • Save comstock/49a4fc84a5046281cd415dc90782bf32 to your computer and use it in GitHub Desktop.

Select an option

Save comstock/49a4fc84a5046281cd415dc90782bf32 to your computer and use it in GitHub Desktop.
How to count the number of JPEG2000 files found to be valid using jpylyzer
jpylyzer *jp2 | grep --extended-regexp "<isValid format=\"jp2\">True</isValid>" | wc --lines
@comstock
Copy link
Copy Markdown
Author

comstock commented Jun 1, 2018

  • Jpylyzer produces a detailed XML report for each analyzed file, and each valid file with produce a line that includes <isValid format="jp\">True</isValid>.
  • Piping the output through [grep](https://linux.die.net/man/1/grep] searching for all occurrences of <isValid format="jp\">True</isValid>will generate one line for each occurrence.
  • Piping the grep output through wc using the --lines switch will return a count of each file found <isValid format="jp\">True</isValid>.

Comparing the number of files found valid against the know number of JP2 files examined provides a quick method of QC: If the total number of JP2 files matches the number found to be valid, no additional QC is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment