Skip to content

Instantly share code, notes, and snippets.

@stevenvo
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevenvo/8c46690f2b7414e6d522 to your computer and use it in GitHub Desktop.
Save stevenvo/8c46690f2b7414e6d522 to your computer and use it in GitHub Desktop.
Convert images to PDF in order of filename, with text prefix and numerical suffix, such as Untitled-0.jpg, Untitled-1.jpg, etc.
ls tap1/*.jpg | sort -t- -nk2,2 | tr '\n' ' ' | sed 's/$/\ tap1.pdf/' | xargs convert
@stevenvo
Copy link
Author

ls bay_vien_ngoc_rong__010*.jpg | sort -t_ -nk2,2 | tr '\n' ' ' | sed 's/$/\ tap10.pdf/' | xargs convert

@stevenvo
Copy link
Author

ls bay_vien_ngoc_rong__$1*.jpg | sort -t_ -nk2,2 | tr '\n' ' ' | sed "s/$/\ tap$1.pdf/" | xargs convert

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