Jump to content

how to alphabeticaly sort files in bat file?


Recommended Posts

Posted

I have file archives that need to be extracted in sequence based on the archive names.

To do this, I think I need to iterate through all files in archives directory, pickup those falling into archives pattern (like "WeeklyUpdates????????.zip", sort them alphabeticaly (probably in a separate file) and then iterate through the file feeding them to unzip utility. But I have no idea how to implement this in bat file.

Thanks in advance.

  • Replies 4
  • Created
  • Last Reply

Popular Days

Guest Pegasus \(MVP\)
Posted

Re: how to alphabeticaly sort files in bat file?

 

 

"ILiya" <iliya00@yandex.ru> wrote in message

news:uXqZuoqeIHA.5280@TK2MSFTNGP02.phx.gbl...

I have file archives that need to be extracted in sequence based on the

archive names.

To do this, I think I need to iterate through all files in archives

directory, pickup those falling into archives pattern (like

"WeeklyUpdates????????.zip", sort them alphabeticaly (probably in a separate

file) and then iterate through the file feeding them to unzip utility. But I

have no idea how to implement this in bat file.

Thanks in advance.

 

=============

 

This may need a little more thinking about, e.g.

- Why would you need to sort the files before unzipping them?

- Where should the unzipped files go?

Posted

Re: how to alphabeticaly sort files in bat file?

 

ILiya wrote:

> I have file archives that need to be extracted in sequence based on

> the archive names.

> To do this, I think I need to iterate through all files in archives

> directory, pickup those falling into archives pattern (like

> "WeeklyUpdates????????.zip", sort them alphabeticaly (probably in a

> separate file) and then iterate through the file feeding them to

> unzip utility. But I have no idea how to implement this in bat file.

> Thanks in advance.

 

At the command prompt, type "SORT /?" for instructions.

Posted

Re: how to alphabeticaly sort files in bat file?

 

> =============

>

> This may need a little more thinking about, e.g.

> - Why would you need to sort the files before unzipping them?

These archives contain antivirus updates with the parttern part ???????? actually representing YYYYMMDD date stamp.

As software provider stipulated, the archives may contain duplicate files in which case the latter archive should take precedence.

Hope for further help.

Guest Pegasus \(MVP\)
Posted

Re: how to alphabeticaly sort files in bat file?

 

 

"ILiya" <iliya00@yandex.ru> wrote in message

news:uLj8PuxeIHA.536@TK2MSFTNGP06.phx.gbl...

> =============

>

> This may need a little more thinking about, e.g.

> - Why would you need to sort the files before unzipping them?

These archives contain antivirus updates with the parttern part ????????

actually representing YYYYMMDD date stamp.

As software provider stipulated, the archives may contain duplicate files in

which case the latter archive should take precedence.

Hope for further help.

 

============

 

Mhm. As far as I remember, there were two questions.


×
×
  • Create New...