Find files: find file names from filelist

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Find files: find file names from filelist

Post by *DrShark »

Before moving the topic to Suggestions forum, let's make sure TC can't do my task.

The task: I want to find a lot of files with certain names,
and the list of names is so long so it exceeds "Search for" character limit in Find files tool,
which currently, if counted right, is 2046 characters. Additionaly, I want to find that names in several paths.

Help says:
Search in:
...
You can enter the name of a text file (ANSI, UTF-8 or UTF-16, the latter two with BOM) containing a list of files and directories to be searched, in the form @c:\path\filelist.txt
So I made a file with text like that:
c:\1path\
c\1path name with space\
"name1.txt"
"name2.txt"
... a lot of names ...
"last name"
I named that file c:\path\filelist.txt (just like Help suggests :)), and
put @c:\path\filelist.txt in "Search in" field, with "Search for" field left empty.

I excpected that TC will find files listed in a filelist.txt in directories and subdirectories of
c:\1path\
c\1path name with space\

Insted, TC found all files in
c:\1path\
c\1path name with space\
and their subdirectories.

So either I do something wrong or the my task can't be done with Find Files.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
Ovg
Power Member
Power Member
Posts: 755
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

try set Search in subdirectories to 1 level(s)
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
User avatar
milo1012
Power Member
Power Member
Posts: 1158
Joined: 2012-02-02, 19:23 UTC

Re: Find files: find file names from filelist

Post by *milo1012 »

I'm not sure what exactly your task here is, because:
DrShark wrote:I excpected that TC will find files listed in a filelist.txt in directories and subdirectories of
c:\1path\
c\1path name with space\

Insted, TC found all files in
c:\1path\
c\1path name with space\
and their subdirectories.
I don't see a difference on your wording.
So what exactly did you expect to happen?
No recursive search in sub-dirs? If so, you could do what ovg suggested.

Anyway, what you can do is using Wildcards.

Code: Select all

c:\1path\*name1.txt
c:\1path\*name2.txt
So just use some editor and prefix paths to your file names via Search & Replace.
You shouldn't use separate dir and file entries.
TC plugins: PCREsearch and RegXtract
User avatar
Gral
Power Member
Power Member
Posts: 1609
Joined: 2005-01-26, 15:12 UTC

Post by *Gral »

2 milo1012
The difference is:
1. files listed in filelist.txt
2. all files
User avatar
milo1012
Power Member
Power Member
Posts: 1158
Joined: 2012-02-02, 19:23 UTC

Post by *milo1012 »

Gral wrote:2 milo1012
The difference is:
1. files listed in filelist.txt
2. all files
Maybe, maybe not.
I still think the wording is ambiguous.
It's not clear what exactly was expected.
DrShark wrote:I excpected that TC will find files listed in a filelist.txt in directories and subdirectories of
c:\1path\
c\1path name with space\
What makes you think that this would work?
A dir entry in the list file is treated like any file entry:
TC help wrote:The file must contain one file/directory name per line, either an absolute path, or relative to the location of the list file
So either prefix the start path to every entry, like I stated above, or put the list file in a location relative to your desired start path.
TC plugins: PCREsearch and RegXtract
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

2milo1012
Gral above explained the difference right.
milo1012 wrote:

Code: Select all

c:\1path\*name1.txt
c:\1path\*name2.txt
That works, thanks. Although I'll do some more checks, because I suspect there might be some
differrences between quotes, wildcards and spaces handling by TC in "Search in", "Search for" and the filenamelist.

2ghisler(Author)
Anyway, there is one... drawback... with a solution form milo1012:
it will make my filelist very large, because I'll have to list all the filenames for each directory,
so it will be like that:

Code: Select all

c:\1path\*name1.txt
...
c:\1path\*nam100.txt
---
d:\100path\*nam1.txt
...
d:\100path\*nam100.txt
Would be nice to have two filenamelists: on for places where to search, and
one for names of objects (files, folders) we want to find.
So in "Search for:" field we colud put @c:\path\searchnameslist.txt with just names we want to find,
and in "Search in:" @c:\path\locationslist.txt - a small file with just a list of places where to search.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Post Reply