Home > Enterprise >  Batch concatenate multiple .ts files to single file in order
Batch concatenate multiple .ts files to single file in order

Time:11-16

I am trying to merge multiple .ts files into a single one.

The below script merges files in order if file numbers are less than 10 i.e. A1.ts, A2.ts, ...., A9.ts:

copy /b *.ts joined_files.ts

However, when file numbers are greater than 100, they get merged in the order A1.ts, A10.ts,..., A2.ts, A20.ts, and so on. (Not numerically as expected)

To deal with this issue, I am trying to use a for loop and a variable name iterating over the numbers as below:

:MainProcessNew

set "BaseName=A"
set "FileNumber=1"

:FileNameLoop
set /A FileNumber =1
copy /b "           
  • Related