我的 echo 文件返回了错误的文件顺序

我的 echo 文件返回了错误的文件顺序

因此,我使用 FFmpeg 将 .ts 文件列表合并在一起,为此,我需要创建一个 echo 文件,其中包含按时间顺序排列的所有 .ts 文件的名称。这些文件都以数字命名,在我的情况下,它在 48 到 272 的范围内。

为了创建 echo 文件,我使用以下命令:

(for %i in (*.ts) do @echo file '%i') > mylist.txt

当我在 cmd 中运行此命令时,它会产生输出,但是,它以错误的顺序产生输出。它不是根据其名称(即数字)进行排序,而是根据我不知道的顺序进行排序。

输出如下:

file '100.ts'
file '101.ts'
file '102.ts'
file '103.ts'
file '104.ts'
file '105.ts'
file '106.ts'
file '107.ts'
file '108.ts'
file '109.ts'
file '110.ts'
file '111.ts'
file '112.ts'
file '113.ts'
file '114.ts'
file '115.ts'
file '116.ts'
file '117.ts'
file '118.ts'
file '119.ts'
file '120.ts'
file '121.ts'
file '122.ts'
file '123.ts'
file '124.ts'
file '125.ts'
file '126.ts'
file '127.ts'
file '128.ts'
file '129.ts'
file '130.ts'
file '131.ts'
file '132.ts'
file '133.ts'
file '134.ts'
file '135.ts'
file '136.ts'
file '137.ts'
file '138.ts'
file '139.ts'
file '140.ts'
file '141.ts'
file '142.ts'
file '143.ts'
file '144.ts'
file '145.ts'
file '146.ts'
file '147.ts'
file '148.ts'
file '149.ts'
file '150.ts'
file '151.ts'
file '152.ts'
file '153.ts'
file '154.ts'
file '155.ts'
file '156.ts'
file '157.ts'
file '158.ts'
file '159.ts'
file '160.ts'
file '161.ts'
file '162.ts'
file '163.ts'
file '164.ts'
file '165.ts'
file '166.ts'
file '167.ts'
file '168.ts'
file '169.ts'
file '170.ts'
file '171.ts'
file '172.ts'
file '173.ts'
file '174.ts'
file '175.ts'
file '176.ts'
file '177.ts'
file '178.ts'
file '179.ts'
file '180.ts'
file '181.ts'
file '182.ts'
file '183.ts'
file '184.ts'
file '185.ts'
file '186.ts'
file '187.ts'
file '188.ts'
file '189.ts'
file '190.ts'
file '191.ts'
file '192.ts'
file '193.ts'
file '194.ts'
file '195.ts'
file '196.ts'
file '197.ts'
file '198.ts'
file '199.ts'
file '200.ts'
file '201.ts'
file '202.ts'
file '203.ts'
file '204.ts'
file '205.ts'
file '206.ts'
file '207.ts'
file '208.ts'
file '209.ts'
file '210.ts'
file '211.ts'
file '212.ts'
file '213.ts'
file '214.ts'
file '215.ts'
file '216.ts'
file '217.ts'
file '218.ts'
file '219.ts'
file '220.ts'
file '221.ts'
file '222.ts'
file '223.ts'
file '224.ts'
file '225.ts'
file '226.ts'
file '227.ts'
file '228.ts'
file '229.ts'
file '230.ts'
file '231.ts'
file '232.ts'
file '233.ts'
file '234.ts'
file '235.ts'
file '236.ts'
file '237.ts'
file '238.ts'
file '239.ts'
file '240.ts'
file '241.ts'
file '242.ts'
file '243.ts'
file '244.ts'
file '245.ts'
file '246.ts'
file '247.ts'
file '248.ts'
file '249.ts'
file '250.ts'
file '251.ts'
file '252.ts'
file '253.ts'
file '254.ts'
file '255.ts'
file '256.ts'
file '257.ts'
file '258.ts'
file '259.ts'
file '260.ts'
file '261.ts'
file '262.ts'
file '263.ts'
file '264.ts'
file '265.ts'
file '266.ts'
file '267.ts'
file '268.ts'
file '269.ts'
file '270.ts'
file '271.ts'
file '272.ts'
file '48.ts'
file '49.ts'
file '50.ts'
file '51.ts'
file '52.ts'
file '53.ts'
file '54.ts'
file '55.ts'
file '56.ts'
file '57.ts'
file '58.ts'
file '59.ts'
file '60.ts'
file '61.ts'
file '62.ts'
file '63.ts'
file '64.ts'
file '65.ts'
file '66.ts'
file '67.ts'
file '68.ts'
file '69.ts'
file '70.ts'
file '71.ts'
file '72.ts'
file '73.ts'
file '74.ts'
file '75.ts'
file '76.ts'
file '77.ts'
file '78.ts'
file '79.ts'
file '80.ts'
file '81.ts'
file '82.ts'
file '83.ts'
file '84.ts'
file '85.ts'
file '86.ts'
file '87.ts'
file '88.ts'
file '89.ts'
file '90.ts'
file '91.ts'
file '92.ts'
file '93.ts'
file '94.ts'
file '95.ts'
file '96.ts'
file '97.ts'
file '98.ts'
file '99.ts'

它完全跳过了 48-99 的 ts 文件,并将它们添加到末尾。我不明白我做错了什么,因为我以前使用过这个脚本,而且成功了。

任何帮助都值得赞赏

答案1

名称已排序按照字典顺序,而不是数字,即首先以1作为第一个“字母”的名称,然后以2,等等。

将 2 位数文件重命名为 3 位数,使用开始时为零,例如48.ts048.ts有一些工具可以一次重命名多个文件,例如总指挥官可以做得很友好。

相关内容