Created
November 17, 2017 11:14
-
-
Save PhilippeVay/637a578a10d72de70fe30649607386fd to your computer and use it in GitHub Desktop.
SVG parsing: display viewBox dimensions
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
# In a directory full of SVG files, extract and display values of their viewBox | |
# 1/2 Rough display | |
grep -H -o -i --color -E 'viewbox="([0-9. ]+)?"' *.svg | |
# Output: | |
# uEA01-arrow-down.svg:viewBox="0 0 50 50" | |
# uEA02-arrow-left.svg:viewBox="0 0 50 50" | |
# 2/2 Better display (no more color highlighting with Git Bash on Win 10 though) | |
grep -HoiE --color 'viewbox="([0-9. ]+)?"' *.svg | awk -F '[:"]' '{ print $1 " => \"" $3 "\"" }' | |
# Output: | |
# uEA01-arrow-down.svg => "0 0 50 50" | |
# uEA02-arrow-left.svg => "0 0 50 50" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment