Re: find files which contains certain string
- From: "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 2 Jun 2007 20:48:18 -0500
"Al Dunbar" <AlanDrub@xxxxxxxxxxxxxxxxxxx> wrote in message
news:uG12vSWpHHA.716@xxxxxxxxxxxxxxxxxxxxxxx
"Richard Mueller [MVP]" <rlmueller-nospam@xxxxxxxxxxxxxxxxxxxx> wrote in
message news:eBFKdGSpHHA.4112@xxxxxxxxxxxxxxxxxxxxxxx
Jurgen Heijnen wrote:
Can someone help me creating a script which search for files which
contains
a certain string in the filename. the files are placed in 1 directory
and
there names differ,
I would hope that their names would differ - if not then they'd all be the
same file.
an example: 2383737.2006.01.csv of 4443335.2007.04.csv.
Now I need to search the directory for the filename which contains the
string
"2007.04", which stands for "april 2007".
Can somebody help or get me started
I have an example VBScript program that does this linked here:
http://www.rlmueller.net/FindFiles.htm
Or, at a command prompt:
dir {folder}\*.2007.04.csv
Or if you want to have a script do something with the file once found,
something like this in a batch script:
pushd {folder}
(set _ym=Enter year and month in yyyy.mm format: )
for %%F in (*.%_ym%.csv) do notepad %%F
/Al
Reading Al's answer I just realized I mis-understood the question. The
script I linked searches for files that have a specified string in the file
contents, not in the name of the file. The "dir" command seems the best
solution.
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--
.
- Follow-Ups:
- Re: find files which contains certain string
- From: Jurgen Heijnen
- Re: find files which contains certain string
- References:
- Re: find files which contains certain string
- From: Richard Mueller [MVP]
- Re: find files which contains certain string
- From: Al Dunbar
- Re: find files which contains certain string
- Prev by Date: Re: Move My Documents Folder.
- Next by Date: Re: How to list all files and modified date
- Previous by thread: Re: find files which contains certain string
- Next by thread: Re: find files which contains certain string
- Index(es):
Relevant Pages
|