As "when copying into one file" to sort files in the terminal windows?

Hello!

There is a task to copy/combine video files into one file. Files of about 300. When you run the command "copy /b *.ts joined_files.ts" there is a connection file for the unthinkable sorting:

media_88.ts
media_89.ts
media_9.ts
media_90.ts
media_91.ts

How to do sorting by name to sort was ascending?
June 5th 19 at 21:03
1 answer
June 5th 19 at 21:05
There is the sort command:
sort /?
Great ! And should look like the query in this case? - maryse.Romaguera commented on June 5th 19 at 21:08
After the copy run the file through sort. - Lucio commented on June 5th 19 at 21:11
And you can still example ) that do not catch up - maryse.Romaguera commented on June 5th 19 at 21:14
copy /b *.ts joined_files.ts
sort joined_files.ts /O sorted_joined_files.ts

In the file sorted_joined_files.ts be the sorted list. - Lucio commented on June 5th 19 at 21:17
why will be sorted in the earlier existing file joined_files.ts? - maryse.Romaguera commented on June 5th 19 at 21:20
Will create a new file. The one that is generated by the copy command after sorting can be deleted if it is no longer needed. - Lucio commented on June 5th 19 at 21:23
i.e. in the creation of the separate file now files sorted as:

media_88.ts
media_89.ts
media_90.ts
media_91.ts


and there is no error:
media_89.ts
media_9.ts
media_90.ts
? - maryse.Romaguera commented on June 5th 19 at 21:26
No errors - the file names are text, not numbers, sort sorts lines of the whole file as text. On textual sorting there is no error.
If you want a file with the number 9 was after 8, not after 89, then assign the numbers as: media_09.ts, media_08.ts ... then they will be in his place, if we consider the numeric sort. - Lucio commented on June 5th 19 at 21:29
so I wrote what and how I want )) but the rename is probably faster and more correctly. thank you - maryse.Romaguera commented on June 5th 19 at 21:32

Find more questions by tags cmd/batWindows