Newbie-ish question

Peter Hansen peter at
Tue Nov 20 02:05:36 CET 2001

Patrick Moorman wrote:
> I have a directory containing a large number of files in the format xy.txt
> where x is a string of numbers and/or letters and y is a sequential number
> with either 2 or 3 digits.  Example:  1foo23012.txt or foo12305.txt.  How
> would I go about identifying all of the files in a sequence and moving them
> to their own sub-directory.  

It might help us understand the problem further if you could explain
what it was about:

 mv 1foo23*.txt subdir    (for Windows substitute "move")

which doesn't do what you want?  Do you have lots of other files which
have the same pattern but aren't in sequential order or something?

(Or was this merely a learning exercise, in which case Sean's comment
is still key...)

Peter Hansen, P.Eng.
peter at

More information about the Python-list mailing list