Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#271726 - 09/12/2005 06:13 Renaming lots of files in Windows XP
TigerJimmy
old hand

Registered: 15/02/2002
Posts: 1049
Hi everyone,

I have a directory on an NTFS file system (XP SP2) which contains an absurd number of files (about 90,000). We would like to subdivide these files into directories based on filename. Unfortunately, Windows doesn't seem to be able to handle this many files in a directory. The directory is pretty much un-browseable.

I tried doing this via cgywin, but the mv command segfaults.

I can't seem to figure out how to mount this filesystem rw in knoppix, so apparently rw NTFS isn't there yet. Is this true?

Anyone have any sneaky ideas on how to do this?

Thanks in advance,

Jim

[rant]I am once again dumbfounded that people use this operating system for anything other than playing games. Some large companies actually use it for critical systems. I would fire anyone who made that decision.[/rant]

Top
#271727 - 09/12/2005 06:44 Re: Renaming lots of files in Windows XP [Re: TigerJimmy]
Schido
enthusiast

Registered: 29/03/2005
Posts: 364
Loc: Probably lost somewhere in Wal...
We used to have this problem way back with windows 95, we were able to move files using the dos box then.

edit:
Mounting ntfs rw with knoppix should be possible:
http://homes.esat.kuleuven.be/~decockd/site/myHowTos/applications/ntfsReadWrite/


Edited by Schido (09/12/2005 06:48)
_________________________
Empeg Mk1 #00177, 2.00 final, hijack 4.76

Top
#271728 - 09/12/2005 07:57 Re: Renaming lots of files in Windows XP [Re: TigerJimmy]
RichieC
new poster

Registered: 20/04/2003
Posts: 23
Loc: Birmingham, England
Well... i have an idea about how you could do this..

You could copy the files to a new folder (or set of folders) from a command prompt using XCOPY e.g.

XCOPY C:\source\a*.* C:\A_Files

would copy all the files from the source folder which begin with "a" to the folder "A_Files"

You would need to repeat this to get all the files, and it could take a while with that many files, but it should work!

Hope this helps

Rich

Top
#271729 - 09/12/2005 08:41 Re: Renaming lots of files in Windows XP [Re: RichieC]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Why don't you just use the move command??

Top
#271730 - 09/12/2005 10:05 Re: Renaming lots of files in Windows XP [Re: TigerJimmy]
bonzi
pooh-bah

Registered: 13/09/1999
Posts: 2401
Loc: Croatia
If cygwin's mv dies with this many files, I would go the brute force way: list the names into a file and edit it (sed's or vi's regular expressions come handy) and source the script (as opposed to executing it, thus saving 90000 executions of the shell).
_________________________
Dragi "Bonzi" Raos Q#5196 MkII #080000376, 18GB green MkIIa #040103247, 60GB blue

Top
#271731 - 09/12/2005 11:42 Re: Renaming lots of files in Windows XP [Re: TigerJimmy]
andy
carpal tunnel

Registered: 10/06/1999
Posts: 5915
Loc: Wivenhoe, Essex, UK
I think there must be something a little wrong that machine. I just created 65536 files named "1" to "65536" in a folder to test this out.

I managed to move all the files beginning with "1" to a folder using the move command in about 40 seconds. I then moved 5000 files to another folder using Explorer in about 20 seconds.

Admittedly Explorer takes a while to respond when you first navigate to the folder, but I have seen Linux some GUI file managers behave just as slowly when faced with similar numbers of files.

P.S. in Windows 2000 the Explorer 5000 file move would have taken forever, thankfully they optmised something in Explorer in XP when moving large numbers of files.
_________________________
Remind me to change my signature to something more interesting someday

Top
#271732 - 09/12/2005 12:22 Re: Renaming lots of files in Windows XP [Re: TigerJimmy]
Attack
addict

Registered: 01/03/2002
Posts: 598
Loc: Florida
I used FileSort to move a large group of files around based on the filename.

Windows is slow/unresponsive accessing the folder because every file extension has to be checked to determine the icon. If you have an active virus scanner running it can slow this down a lot. I'm not sure how your trying to move the files but if you select a group of files in the folder and then right click on the selected group windows again has to check every file extension to determine what options you will get. The more programs that you've installed that add shell extensions the more this will slow this down.
_________________________
Chad

Top
#271733 - 09/12/2005 13:30 Re: Renaming lots of files in Windows XP [Re: TigerJimmy]
The Central Guy
enthusiast

Registered: 18/03/2002
Posts: 225
Loc: San Diego, California USA
I use ZTree (A newly written knockoff of the old XTree file manager program). You tag files first to do any sort of operation on them (or use Cntl-T to mass tag) and then use commands like M or CnTL-M to mass-move files. Works like a charm, also very powerful for renaming files. I use it all the time for much of my file manager needs....

It doesn't suffer from that initial lag when starting up in a large directory because you have to log the files first that you want to operate on (Alt-Log-Branch). So it selectively lets you log files to work with.

I've been using XTree and now ZTree for 15 years, great stuff....

Thanks, Randy
_________________________
Happy owner of 2 Centrals, 2 Empegs Mk2a 160GB, 1 Empeg Mk2a 60 GB, a Rio Riot, 4 Rio Receivers, and two 1GB iPod Shuffles...

Top
#271734 - 09/12/2005 13:43 Re: Renaming lots of files in Windows XP [Re: TigerJimmy]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Quote:
the mv command segfaults

I wonder if large numbers of arguments to a command acts in an odd manner under Cygwin. You could try something along the lines of "find . -name <pattern to move> -print0 | xargs -0 mv <dirname>" (both of those "0"s are zeroes). Xargs will chop up the filenames so that mv only runs with a reasonable number of files at any one time.
_________________________
Bitt Faulk

Top
#271735 - 09/12/2005 14:09 Re: Renaming lots of files in Windows XP [Re: TigerJimmy]
Dignan
carpal tunnel

Registered: 08/03/2000
Posts: 12324
Loc: Sterling, VA
Well, technically you don't want exactly what your title implies, but I've been itching to plug a great program I found that does what your subject line asks for:

The Rename!!

It's the best tool I've found for batch renaming files. It seems very powerful, too. It's possible that it might be able to sort into new folders as well, which is part of what you're asking to do.
_________________________
Matt

Top
#271736 - 09/12/2005 15:21 Re: Renaming lots of files in Windows XP [Re: The Central Guy]
lectric
pooh-bah

Registered: 20/01/2002
Posts: 2085
Loc: New Orleans, LA
Oh man.... I remember Xtree (gold)

I used it for EVERYTHING. At the time, it was the only way to delete an entire tree structure. Very powerful and very fast. I need to try Ztree now.

Top
#271737 - 09/12/2005 15:39 Re: Renaming lots of files in Windows XP [Re: wfaulk]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5683
Loc: London, UK
Quote:
I wonder if large numbers of arguments to a command acts in an odd manner under Cygwin.


Yes, it does. Windows maximum command line length is 32K characters, and it's even possible that Cygwin has less space. Large numbers of files will cause it to fail.

Your -print0 | xargs -0 thing is what I normally use if I have this problem.
_________________________
-- roger

Top
#271738 - 10/12/2005 23:55 Re: Renaming lots of files in Windows XP [Re: TigerJimmy]
Anonymous
Unregistered


It sounds like you´ve had several problems with your machine lately. I think what you need is this . It´s the one tool that never lets me down when my computer really starts acting up and refuses to do what I want.

Top
#271739 - 11/12/2005 11:49 Re: Renaming lots of files in Windows XP [Re: Dignan]
tahir
pooh-bah

Registered: 27/02/2004
Posts: 1909
Loc: London
Quote:
I found that does what your subject line asks for:

The Rename!!

It's the best tool I've found for batch renaming files.


Great programme, been using it for years.

Used to love Xtree, might try Ztree

Top