want to search an already prepared filelist for a given file

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
sybariten
Junior Member
Junior Member
Posts: 79
Joined: 2003-05-29, 17:31 UTC

want to search an already prepared filelist for a given file

Post by *sybariten »

Hi there,
i'd like some suggestions on how to solve the following task with TC:
After selecting a file (or several), i want to search an already prepared filelist for that filename. The filelist is a plain text file.

Peace!
**********************************
If this is too easy, here's an extension:
First i'd like to browse around some new dirs on my HD, looking for interesting files that might also appear in my big filelist. When i see a suspicious file, i'd like to execute a command so that the filename is added to the end of a textfile. After having gathered maybe 10 files in that short list, i want to compare it against my long filelist. Actually, no automation is really necessary for that comparision, so perhaps we are outside of the scope of TC here.
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Well, you could use the synchronize dirs tool to compare a file tree with a file list (made eg using the Diskdir plugin) and let it show you only equal (=) files.

To add a filename to a text file, something like "command.com /c echo" as a Command in the Button Bar and "%F >> listfile.txt" as the Parameters. Not sure if it works that way, if not, you might need to use a batch file, something like mybatch.bat containing "@echo %1 >> listfile.txt" and in the Button Bar's the Command would be "mybatch.bat" and the Parameters "%F".

HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
sybariten
Junior Member
Junior Member
Posts: 79
Joined: 2003-05-29, 17:31 UTC

Post by *sybariten »

Welll i've just read this and not tried any of these yet... but THANK YOU! The bat file sounds like just what i need. So, %1 means the first argument just like under unix? and %F is TC's internal way of saying "the selected file" ?

peace
sybariten
Junior Member
Junior Member
Posts: 79
Joined: 2003-05-29, 17:31 UTC

Post by *sybariten »

Hmmm.

Running the simple bat file from the commandline, it works out OK, i even get newlines without having to att a \n to the echo statement.

However, when i have the bat file in the start menu of TC, with either %F or %f as a parameter, i get this kind of output:

C:\DOCUME~1\jake\LOKALA~1\Temp\CMD8C.tmp
C:\DOCUME~1\jake\LOKALA~1\Temp\CMD8D.tmp
C:\DOCUME~1\jake\LOKALA~1\Temp\CMD8E.tmp
C:\DOCUME~1\jake\LOKALA~1\Temp\CMD8F.tmp

these are not the actual files i had chosen, but some sort of temp files.

Any ideas?

peace
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Yes, I apologize, my stupid mistake - it should be %N, not %F. For more of these parameters just go to Configuration - Button Bar - Help.

And %1 in a .bat file indeed means the first passed parameter.

HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
sybariten
Junior Member
Junior Member
Posts: 79
Joined: 2003-05-29, 17:31 UTC

Post by *sybariten »

Thank you! That worked better. :)

Could you explain again how to do the synchronization against a text file, as in your first reply to my question? When i'm using the internal synchronization function, the only way of working i can see is to use two directories, i dont find any options for text files.

Peace
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Using for instance the DiskDir plugin ( http://www.ghisler.com/plugins.htm ) you can create lists of files which you can then browse in TC as directories (so you probably can also synchronize with them, though I have never tried). If you don't want to use DiskDir because you already have some filelists, then try installing DiskDir and then modifying your filelists so they match DiskDir's format.

HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
sybariten
Junior Member
Junior Member
Posts: 79
Joined: 2003-05-29, 17:31 UTC

Post by *sybariten »

OK hacker, now i see what you mean. I instinctively (?) thought that the diskdir plug and similar were just to compile a list of files, but then i tried it and saw the fake filesystem. Very clever.
However, i'm not sure i'm managing to solve my task. I can make the synchronize dirs function work with the fake filesystem(s) , but i cant just find duplicate files, they have to be in mirrored dirs too... or am i misunderstanding something? I've always had a hard time controling the sync. dirs function.
What i'd like, once again, is to find every occurence of the files in the small list, from the big list, and these two different locations dont have to have anything in common. I.e. they dont have the same structure.

Well , if anyone has any ideas, i'd be glad to know.

peace!

ps. i'm thinking of writing a python program that reads two lists, one is turned into a dictionary (the small one) and every file in that dictionary is searched for in the big list. if theres a "hit", or several, its noted in another column in the dictionary. but i dont really wanna do this if i can just use TC)
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

OK, hmm, maybe this way:
Mark the two filelists in DiskDir format or optionally any dir you want to find the duplicate files in.
Press Alt-F7 to bring up the Search window.
Press Alt-R to activate searchng archives (like DiskDir), too.
In the Advanced tab select the Find duplicate files option and choose the options you like.
Start the search and see if it works.

Another, more manual way, would be to press Ctrl-B (directory branch) in the root of the paths you want to find duplicates in. Then sort by name (or size or date, whichever suits you best) and compare the lists manually.

HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Post Reply