intelligent directory name search and renaming

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
tazman
Junior Member
Junior Member
Posts: 4
Joined: 2003-07-28, 17:49 UTC

intelligent directory name search and renaming

Post by *tazman »

Hi Guys

I am new here and have just started using TC. I wanted to know if I can do the following directory search and renaming.

I have 2 lists of diectories in the following pattern

list 1 list2
wwww.xxx.yyy.zzz xxx.yyy.zzz


I would like TC to search list 1 for xxx.yyy.zzz ( present in list2) and rename the folder/directory name to xxx.yyy.zzz in list1.

the name search should be done ina way so that it ignores the '.' in the names, to find the best match.
It should do it for every folder/directory in list2 automatically. This is a kind of synchronizarion that I need.

May be combination of renaming tool and sync tool might be able to do it. But I dont know

wwww.xxx.yyy.zzz and xxx.yyy.zzz can have identical files or they can be different.

bascially I am tryin to search 'xxx.yyy.zzz' in 'wwww.xxx.yyy.zzz' and change 'wwww.xxx.yyy.zzz' to 'xxx.yyy.zzz'.

Any help would be greatly appreciated :)

Thanks and Best Wishes

taz
tazman
Junior Member
Junior Member
Posts: 4
Joined: 2003-07-28, 17:49 UTC

Post by *tazman »

Sorry guys !!

Tabs didnt make it in my earlier post. So here is what the 2 directory listings look like.

list 1 = wwww.xxx.yyy.zzz

list 2 = xxx.yyy.zzzz

I want to do

'wwww.xxx.yyy.zzz' <-> 'xxx.yyy.zzzz'

depending upon how well they match . Agian its just the folder or directory name I want to change or rename not the files inside them.

Thanks again
User avatar
CADweazle
Senior Member
Senior Member
Posts: 297
Joined: 2003-04-03, 09:10 UTC
Location: Freiburg i.Br. Deutschland

Post by *CADweazle »

You´re welcome!

Try this:
- make a search by pressing "ALT-F7" and enter the desired pattern.
- Afterwords - if the search was successfull, klick the button "Feed to listbox"

You'll notice, that all hits are listed in the left window!

- select all directories (left klick or INS) and enter "CTRL-T"
- change the names at your desires...

Grettings,
Cheer up, Karl
tazman
Junior Member
Junior Member
Posts: 4
Joined: 2003-07-28, 17:49 UTC

Post by *tazman »

Hi cad

Thanks for your reply. I think your way will work when I need to change the name of one folder at a time.

But what I really want is it should match each folder in one listing to the folders in the seocnd listings. If it finds the folder then rename it .
All should be done automatcially.

Once first folder is done then go the second folder and search it in the seocnd listing and rename if applicable and so on.

I started with 2 different listings and

At the end I will have 2 identical listings in the ideal case.


for example

listing 1

1234.abc12.xyz
4567.edf88.ghy

listing 2

abc12.xyz
edf88.ghy

1234.abc12.xyz compared with abc12.xyz '1234.1bc12.xyz' is changed to abc12.xyz.

going to the second folder

4567.edf88.ghy compared with edf88.ghy 4567.edf88.ghy converted to edf88.ghy

and so on

end result

listing 1

abc12.xyz
edf88.ghy

listing2

abc12.xyz
edf88.ghy

Bascially here we have ignored first 5 letters when doing the matching

Hopefully this makes my problem more clear :) If you know of any other utility that will do it .. do let me know.

In the ideal case whole process should be fire and forget :)

Thanks again
User avatar
CADweazle
Senior Member
Senior Member
Posts: 297
Joined: 2003-04-03, 09:10 UTC
Location: Freiburg i.Br. Deutschland

Post by *CADweazle »

Sorry, :(
the only way I could imagine to do that would be a wsh-script.
Shouldn't be too complicated - just a little bit of string fumbling. :)

Greetings,
Cheer up, Karl
tazman
Junior Member
Junior Member
Posts: 4
Joined: 2003-07-28, 17:49 UTC

Post by *tazman »

Hi Cad

thanks again for rpleying, could you give me any link about how to make wsh-script or some thing similar plz ?


thanks
User avatar
CADweazle
Senior Member
Senior Member
Posts: 297
Joined: 2003-04-03, 09:10 UTC
Location: Freiburg i.Br. Deutschland

Post by *CADweazle »

Boah,

you'll find a multitude of links in the web:
Just search for Windows Scritpting Host or .vbs...

Microsoft offers in their MSDN a complete descrition...

Or just buy a book about the WSH-Program-language

Good luck, :)
Cheer up, Karl
jb
Senior Member
Senior Member
Posts: 412
Joined: 2003-02-09, 22:56 UTC
Location: Switzerland

Post by *jb »

CADweazle wrote:Just search for Windows Scritpting Host or .vbs...
.vbs is the extension for VBScript (Visual Basic Script). I really recommend to use JScript (Microsoft's variant of JavaScript/ECMAScript) instead of VBScript.
User avatar
CADweazle
Senior Member
Senior Member
Posts: 297
Joined: 2003-04-03, 09:10 UTC
Location: Freiburg i.Br. Deutschland

Post by *CADweazle »

2jb

For a beginner?? :roll:
And if you recommand it - what are the benefits of Microsofts homebrew in your opinion???
Cheer up, Karl
jb
Senior Member
Senior Member
Posts: 412
Joined: 2003-02-09, 22:56 UTC
Location: Switzerland

Post by *jb »

CADweazle wrote:For a beginner?? :roll:
Yes, JScript is not much more complex than VBScript and you don't need to use all features of JScript right from the start.
CADweazle wrote:And if you recommand it - what are the benefits of Microsofts homebrew in your opinion???
VBScript is a 100% proprietary (homebrew) language of Microsoft while JScript is an implementation of the ECMAScript standard (inspired by Netscape's JavaScript) which is also supported by non-Microsoft products such as Mozilla. Furthermore the syntax of JScript is similar to C++ and Java, the languages of choice nowadays.

PS: JScript/JavaScript is also partly derived from Perl, especially its support of regular expressions (wonderful!).
Post Reply