Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

For Schleife sortieren

5 views
Skip to first unread message

Axel Berger

unread,
Feb 16, 2013, 7:55:16 AM2/16/13
to
I'm using 4DOS. Using the command

for %a in (acc*) do type %a >> logneu.txt

it is obvious they're executed in their natural order. If those files
were copied before I often hit the Windows idiosyncracy, that the first
in alphabetical order comes last, requiring manual correction. Is there
a way to make For use a predifined oder like aphabetical or age?

Danke
Axel

E. S. Fabian

unread,
Feb 16, 2013, 8:20:44 AM2/16/13
to
Axel Berger:
Sorry, not in 4DOS; not even in TCC/LE. The /O (order) option was added in
TCC version 11.

You can use the DIR command to create an ordered list of the files to be
processed in a temporary file (or in the clipboard), and retrieve them
(WARNING! NOT TESTED!):

dir /b /o:d acc* > clip:
( for %a in (@clip:) type %a ) > logneu.txt

Note that instead of redirecting each TYPE command individually the output
of the whole FOR loop is redirected. This is not essential, it is just a
techniqued you may not be aware of.
--
HTH, Steve


foxidrive

unread,
Feb 16, 2013, 9:41:12 AM2/16/13
to
On 17/02/2013 12:20 AM, E. S. Fabian wrote:
> Axel Berger:
>
> | I'm using 4DOS. Using the command
> |
> | for %a in (acc*) do type %a >> logneu.txt
> |
> | it is obvious they're executed in their natural order. If those
> | files were copied before I often hit the Windows idiosyncracy, that
> | the first in alphabetical order comes last, requiring manual
> | correction. Is there a way to make For use a predifined oder like
> | aphabetical or age?

> (WARNING! NOT TESTED!):
>
> dir /b /o:d acc* > clip:
> ( for %a in (@clip:) type %a ) > logneu.txt

This will sort by name: dir /b /o:n

The unsorted dir listings is an issue with FAT32/16/12, and NTFS sorts files alphabetically by default.


Another thing to watch is if acc* is a set of .txt files then make the target file a different extension
and rename it after the command. This gets around a bug in for-in-do.


--
foxi

Richard Bonner

unread,
Feb 18, 2013, 6:23:56 AM2/18/13
to
Axel Berger (Axel....@Gmx.De) wrote:
> I'm using 4DOS. Using the command

> for %a in (acc*) do type %a >> logneu.txt

> it is obvious they're executed in their natural order. If those files
> were copied before I often hit the Windows idiosyncracy, that the first
> in alphabetical order comes last, requiring manual correction. Is there
> a way to make For use a predefined order like aphabetical or age?
>
> Axel

*** In real DOS, this can be done by using a resort utility such as
Norton's DS.exe (Directory Sort). It physically reorders file namess in a
directory. Afterward, any listing, copying or other operation will then
happen in the type of order you select.

XSET, and possibly XXCOPY, could be used to do this operation, but I
can't take the time right now to think of the steps required.

I think the idea proposd by another poster of using DIR to send an
alphabetical list to a file and then using it as input to type each file
is likely the best for you.

--
Richard Bonner
http://www.chebucto.ca/~ak621/DOS/

Axel Berger

unread,
Feb 18, 2013, 9:41:53 AM2/18/13
to
Richard Bonner wrote:
> I think the idea proposd by another poster of using DIR to send an
> alphabetical list to a file and then using it as input to type each
> file is likely the best for you.

I agree.
0 new messages