how do I sort files... - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

how do I sort files...

webguzswebguzs Posts: 4Member
How do I sort files that are currently in 1 dir under the naming convention 1-001 2-0001 3-001, 1-002 2-002 3-002 etc.

There must be a dos command sequence to search and sort the files so they can be sorted and moved to a new dir.

win2k o/s

can anyone assist?

Thank you

webguzs@yahoo.com

Comments

  • IDKIDK Posts: 1,784Member
    : How do I sort files that are currently in 1 dir under the naming convention 1-001 2-0001 3-001, 1-002 2-002 3-002 etc.
    :
    : There must be a dos command sequence to search and sort the files so they can be sorted and moved to a new dir.
    :
    : win2k o/s
    :
    : can anyone assist?
    :
    : Thank you
    :
    : webguzs@yahoo.com
    :
    Why sort them? There's no use in sorting them in dos...
    Do a batch script that move's all the files.

    The one and only [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]

  • webguzswebguzs Posts: 4Member
    ok, however i dont know how to write a batch script
    i need tem resorted in the following sequence

    1-001 1-002 1-003
    2-001 2-002 2-003

    i have 5,000 files in a single dir with the file structure so i need
    them sorted so i can put htem in individual folders

    THanks


    : : How do I sort files that are currently in 1 dir under the naming convention 1-001 2-0001 3-001, 1-002 2-002 3-002 etc.
    : :
    : : There must be a dos command sequence to search and sort the files so they can be sorted and moved to a new dir.
    : :
    : : win2k o/s
    : :
    : : can anyone assist?
    : :
    : : Thank you
    : :
    : : webguzs@yahoo.com
    : :
    : Why sort them? There's no use in sorting them in dos...
    : Do a batch script that move's all the files.
    :
    : The one and only [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
    :
    :

  • IDKIDK Posts: 1,784Member
    : 1-001 1-002 1-003
    : 2-001 2-002 2-003

    like all begining with 1 in a folder called 1?

    The one and only [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]

  • webguzswebguzs Posts: 4Member
    : : 1-001 1-002 1-003
    : : 2-001 2-002 2-003
    :
    : like all begining with 1 in a folder called 1?
    :
    : The one and only [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
    :
    the number before the - is incremental for each series of files
    and the numbers after the - are incremental as well, they are also not consistant with the finishing number

    currently there are 5000 files in a dir which comprise series of about 50 files each , and with the above naming convention (sorting by the 1st digit) all the series are mixed, exemple: 1-001 2-001 3-001
    i need the sorted like this: 1-001 1-002 1-003

    any suggestions?
  • IDKIDK Posts: 1,784Member
    : : : 1-001 1-002 1-003
    : : : 2-001 2-002 2-003
    : :
    : : like all begining with 1 in a folder called 1?
    : :
    : : The one and only [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
    : :
    : the number before the - is incremental for each series of files
    : and the numbers after the - are incremental as well, they are also not consistant with the finishing number
    :
    : currently there are 5000 files in a dir which comprise series of about 50 files each , and with the above naming convention (sorting by the 1st digit) all the series are mixed, exemple: 1-001 2-001 3-001
    : i need the sorted like this: 1-001 1-002 1-003
    :
    : any suggestions?
    :
    There is no use to sort in dos, but it's easy to write a batch script to put the file's in separete folders. Could you please explain to me why you want to sort.

    The one and only [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]

  • MargaloMargalo Posts: 75Member
    : : : : 1-001 1-002 1-003
    : : : : 2-001 2-002 2-003
    : : :
    : : : like all begining with 1 in a folder called 1?
    : : :
    : : : The one and only [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
    : : :
    : : the number before the - is incremental for each series of files
    : : and the numbers after the - are incremental as well, they are also not consistant with the finishing number
    : :
    : : currently there are 5000 files in a dir which comprise series of about 50 files each , and with the above naming convention (sorting by the 1st digit) all the series are mixed, exemple: 1-001 2-001 3-001
    : : i need the sorted like this: 1-001 1-002 1-003
    : :
    : : any suggestions?
    : :
    : There is no use to sort in dos, but it's easy to write a batch script to put the file's in separete folders. Could you please explain to me why you want to sort.
    :
    : The one and only [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
    :
    :
    Umm, if you mean to put them in the 123456789 kinda mumerical thing so when to type dir it looks all pretty and stuff fine. but first could you tell me a few things. 1. what are these files anyway? 2. If you using win2k then why don't you just go into the folder the windows way and rearrange your files to your hearts content 3. If not just to make it look pretty why do you so [Italic] Need [/italic] to be sorted anyway?
  • addyk2004addyk2004 Posts: 60Member
    : : : : : 1-001 1-002 1-003
    : : : : : 2-001 2-002 2-003
    : : : :
    : : : : like all begining with 1 in a folder called 1?
    : : : :
    : : : : The one and only [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
    : : : :
    : : : the number before the - is incremental for each series of files
    : : : and the numbers after the - are incremental as well, they are also not consistant with the finishing number
    : : :
    : : : currently there are 5000 files in a dir which comprise series of about 50 files each , and with the above naming convention (sorting by the 1st digit) all the series are mixed, exemple: 1-001 2-001 3-001
    : : : i need the sorted like this: 1-001 1-002 1-003
    : : :
    : : : any suggestions?
    : : :
    : : There is no use to sort in dos, but it's easy to write a batch script to put the file's in separete folders. Could you please explain to me why you want to sort.
    : :
    : : The one and only [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
    : :
    : :
    : Umm, if you mean to put them in the 123456789 kinda mumerical thing so when to type dir it looks all pretty and stuff fine. but first could you tell me a few things. 1. what are these files anyway? 2. If you using win2k then why don't you just go into the folder the windows way and rearrange your files to your hearts content 3. If not just to make it look pretty why do you so [Italic] Need [/italic] to be sorted anyway?
    :

    [blue]
    Here is the way I'd do it:
    Make a batch file [BATCH.BAT] and put it in the folder with those files.
    Then Right-click the file and choose edit. And enter the next lines.
    [code]
    [blue]
    mkdir 10
    move 10*?.* 10
    mkdir 11
    move 11*?.* 11
    ...
    mkdir 19
    move 19*?.* 19
    mkdir 20
    move 20*?.* 20
    ...
    ...
    ...
    mkdir 99
    move 99*?.* 99

    mkdir 1
    move 1*?.* 1
    mkdir 2
    move 2*?.* 2
    ...
    mkdir 9
    move 9*?.* 9
    [/blue]
    [/code]
    That's if your files might pe starting also with 15-001 stile of nameing.
    If your files start only with one digit before - you can write only the last part.
    Hope this helped. :D
    [/blue]
    [code][blue][size=5]AddyK[/size] (addyk2004), E-mail: addyk2003@walla.com (I know it should be 2004)[/blue][/code]

Sign In or Register to comment.