Sort

對pdfbeads中的輸入文件進行排序

  • June 23, 2020

我正在嘗試使用數百個 .tif 圖像製作 pdf 文件pdfbeads。我無法讓程序以正確的數字順序使用圖像。例如,在此過程中,我看到:

Prepared data for processing image-098.tif
Prepared data for processing image-099.tif
Prepared data for processing image-100.tif
Prepared data for processing image-1000.tif
Prepared data for processing image-1001.tif
Prepared data for processing image-1002.tif
Prepared data for processing image-1003.tif
Prepared data for processing image-1004.tif
Prepared data for processing image-1005.tif
Prepared data for processing image-1006.tif
Prepared data for processing image-1007.tif
Prepared data for processing image-1008.tif
Prepared data for processing image-1009.tif
Prepared data for processing image-101.tif
Prepared data for processing image-1010.tif
Prepared data for processing image-1011.tif
Prepared data for processing image-1012.tif

使用以下命令,我得到正確的命令

ls -v

所以我嘗試了

pdfbeads $(ls -v) > file.pdf

沒有結果。

如果計數達到 1000 張圖像,那麼我們必須在所有數字中使用 4 位數字才能正確排序。這可以通過重命名命令來完成:

rename image- image-0 *-[0-9][0-9][0-9].tif

完畢!

image-0229.tif     image-0487.tif  image-0745.tif  image-1003.tif
image-0230.tif     image-0488.tif  image-0746.tif  image-1004.tif
image-0231.tif     image-0489.tif  image-0747.tif  image-1005.tif
image-0232.tif     image-0490.tif  image-0748.tif  image-1006.tif
image-0233.tif     image-0491.tif  image-0749.tif  image-1007.tif
image-0234.tif     image-0492.tif  image-0750.tif  image-1008.tif
image-0235.tif     image-0493.tif  image-0751.tif  image-1009.tif
image-0236.tif     image-0494.tif  image-0752.tif  image-1010.tif
image-0237.tif     image-0495.tif  image-0753.tif  image-1011.tif
image-0238.tif     image-0496.tif  image-0754.tif  image-1012.tif
image-0239.tif     image-0497.tif  image-0755.tif  image-1013.tif

引用自:https://unix.stackexchange.com/questions/594342