Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Export search results

1 view
Skip to first unread message

Phil James

unread,
Nov 4, 2006, 3:10:03 PM11/4/06
to

If you use the "find" search system under "start," you get a list of files.
How can that list be exported to an Excel spreadsheet? ...or printed out?

I have an IBM ThinkPad A20m 2820 running Windows SE.

Phil James

Don Phillipson

unread,
Nov 4, 2006, 4:23:39 PM11/4/06
to
"Phil James" <james...@alum.mit.edu> wrote in message
news:uc6YnHFA...@TK2MSFTNGP02.phx.gbl...

>
> If you use the "find" search system under "start," you get a list of
files.
> How can that list be exported to an Excel spreadsheet? ...or printed out?

Make use of
/ Options / Save Results
(and provide a TXT or all-ASCII filename.)

Don Phillipson
Carlsbad Springs
(Ottawa, Canada)


Gary S. Terhune

unread,
Nov 4, 2006, 6:39:29 PM11/4/06
to
Use the DIR command in a Command prompt. Only drawback is that the resulting
file is not TAB separated and is not quickly, easily, imported into Excel.
For that purpose, you'd probably need a third-party app (don't think it can
be done with any basic Windows apps.)

***************************************
Displays a list of files and subdirectories in a directory.

DIR [drive:][path][filename] [/P] [/W] [/A[[:]attributes]]
[/O[[:]sortorder]] [/S] [/B] [/L] [/V] [/4]

[drive:][path][filename]
Specifies drive, directory, and/or files to list.
(Could be enhanced file specification or multiple filespecs.)
/P Pauses after each screenful of information.
/W Uses wide list format.
/A Displays files with specified attributes.
attributes D Directories R Read-only files
H Hidden files A Files ready for archiving
S System files - Prefix meaning not
/O List by files in sorted order.
sortorder N By name (alphabetic) S By size (smallest first)
E By extension (alphabetic) D By date & time (earliest
first)
G Group directories first - Prefix to reverse order
A By Last Access Date (earliest first)
/S Displays files in specified directory and all subdirectories.
/B Uses bare format (no heading information or summary).
/L Uses lowercase.
/V Verbose mode.
/4 Displays year with 4 digits (ignored if /V also given).

Switches may be preset in the DIRCMD environment variable. Override
preset switches by prefixing any switch with - (hyphen)--for example, /-W.
***************************************************

As you can see, this DIR command can be used to locate specific files. To
pipe the results to a text file, at the end of whatever command you use add:
">[path]find_results.txt" (without quotes) where [path] (without brackets)
is the directory you want to place the results file in, and "find_results"
is the name of the file.

For best results, you should start in the root of the drive you are
searching. To do this, use the CD (change directory) command:
cd c:\

For a different drive, just type "d:", "e:" (without quotes), etc., followed
by <enter>. No need for the CD part.

Examples:
To locate all files named "*.doc", looking in the entire C:\ drive, and save
the results to C:\Find_DOC.txt
dir *.doc /S >C:\Find_DOC.txt

To restrict the same search to C:\My Documents:
dir "C:\my documents\*.doc" /S >C:\Find_DOC.txt

Note that whenever a path and/or filename includes any spaces, you must
enclose the entire path in "quotation marks".

To do that same search looking *only* in My Documents, but not sub-folders,
leave out the /S switch.
dir "C:\my documents\*.doc" >C:\Find_DOC.txt

For this purpose, the /W and /P switch are not useful. However, the rest can
come in handy.

--
Gary S. Terhune
MS MVP Shell/User
http://grystmill.com/articles/cleanboot.htm
http://grystmill.com/articles/security.htm

"Phil James" <james...@alum.mit.edu> wrote in message
news:uc6YnHFA...@TK2MSFTNGP02.phx.gbl...
>

PCR

unread,
Nov 5, 2006, 3:45:50 PM11/5/06
to
That is all well & good, really. HOWEVER, after many months of
puzzlement, I found out the hard way that "/S" won't reach into a Hidden
or a System folder...

C:\>dir c:\Autoexec.bat /s /a
Directory of C:\
AUTOEXEC BAT 557 02-24-05 1:17a AUTOEXEC.BAT
1 file(s) 557 bytes

Directory of C:\WINDOWS\TEMP
AUTOEXEC BAT 1,103 04-23-99 10:22p AUTOEXEC.BAT
1 file(s) 1,103 bytes

Total files listed:
2 file(s) 1,660 bytes

...BUT, I have one in...

C:\>dir C:\system.sav\autoexec.bat
Directory of C:\system.sav
AUTOEXEC BAT 251 11-15-99 2:36p autoexec.bat
1 file(s) 251 bytes

..., which is attributed Hidden. (System also would do it.)...

C:\>attrib C:\System.sav
H SYSTEM.SAV C:\system.sav

That is a sad "feature" of DOS, as I do have 11 directories attributed
System...

C:\>dir /s /ads
...snip
Total files listed:
11 dir(s) 6,701.66 MB free

...And 34 directories that are Hidden...

C:\>dir /s /adh
Total files listed:
34 dir(s) 6,701.66 MB free


--
Thanks or Good Luck,
There may be humor in this post, and,
Naturally, you will not sue,
should things get worse after this,
PCR
pcr...@netzero.net
"Gary S. Terhune" <grys...@mvps.org> wrote in message
news:ua%23z6pGA...@TK2MSFTNGP04.phx.gbl...

Gary S. Terhune

unread,
Nov 6, 2006, 5:38:08 PM11/6/06
to
Thanks for reminding me. Yes, the default is to *not* include files with H
and/or S attributes. Always has been thus with the DIR command. To get all
of them, you need to do one search w/o any attributes included, then one for
H-only, then one for S-only, and finally one for H+S. These last three lists
will necessarily include duplications. You'd want to merge the lists to get
those with *only* H, *only* S and H+S. But as noted (I think I noted it) the
output is not really good for putting into Excel without first running a
script that would properly convert the results to a tab-delineated CSV file.
I've done similar things before, (specifically recall converting a
collection of HTML database output records to a remerged CSV file.) Might
even have the scripts around here somewhere, only needing to be somewhat
altered.

--

Gary S. Terhune
MS-MVP Shell/User
http://grystmill.org/articles/cleanboot.htm
http://grystmill.org/articles/security.htm

"PCR" <pcr...@netzero.net> wrote in message
news:ex87MDSA...@TK2MSFTNGP02.phx.gbl...

PCR

unread,
Nov 6, 2006, 7:53:50 PM11/6/06
to
"Gary S. Terhune" <grys...@mvps.org> wrote in message
news:uvv58Qf...@TK2MSFTNGP04.phx.gbl...

| Thanks for reminding me. Yes, the default is to *not* include files
with H
| and/or S attributes. Always has been thus with the DIR command. To get
all
| of them, you need to do one search w/o any attributes included, then
one for
| H-only, then one for S-only, and finally one for H+S.

I'm no perfect expert in DOS. Actually, though, I find "/a" alone will
display all files regardless of attributes. "DIR /s /a" goes into every
folder— EXCEPT for FOLDERS that are themselves attributed System or
Hidden. That's the insidious thing. If the H or S folder is the current
folder or is mentioned in the DIR, then it's H or S files will be
displayed, however. But it still won't go into H & S sub-folders to
that!

| These last three lists
| will necessarily include duplications. You'd want to merge the lists
to get
| those with *only* H, *only* S and H+S.

No. "/A" alone displays all attributes.

|But as noted (I think I noted it) the
| output is not really good for putting into Excel without first running
a
| script that would properly convert the results to a tab-delineated CSV
file.
| I've done similar things before, (specifically recall converting a
| collection of HTML database output records to a remerged CSV file.)
Might
| even have the scripts around here somewhere, only needing to be
somewhat
| altered.

I used to do similar long ago, but on IBM mainframe computers usiing
CMS.

Gary S. Terhune

unread,
Nov 6, 2006, 8:10:30 PM11/6/06
to
That will not do what's asked, Don. All you get is a shortcut thingy that
repeats the search, not a results file like OP wants.

--


"Don Phillipson" <d.phillips...@rogers.com> wrote in message
news:e2VYLeFA...@TK2MSFTNGP04.phx.gbl...

Gary S. Terhune

unread,
Nov 6, 2006, 8:15:59 PM11/6/06
to
Another cool trick. Learn something every day. So the /A switch includes all
attributes, which effectively includes all files. But you can't get into
Hidden+System subfolders? Something to remember.

Oh well, it's a klutzy way to do what the OP wants, anyway. I think a
third-party utility is called for. There's an interesting freeware offering
here:
http://www.jam-software.com/freeware/index.shtml

Near the bottom of the page, FileList V1.5
http://www.jam-software.com/freeware/FileList.zip

"FileList is a command line utility that produces a list of files of the
given path in the CSV format, which can be imported in a spreadsheet or
database. The list includes the file name, the size, the path, the file
extension, the owner of the file (only Windows NT/2000/XP) as well as the
last access and change date and the creation date of the file. Optionally
the author of MS Office documents can be displayed."

--


"PCR" <pcr...@netzero.net> wrote in message

news:%237wwWcg...@TK2MSFTNGP03.phx.gbl...


> "Gary S. Terhune" <grys...@mvps.org> wrote in message
> news:uvv58Qf...@TK2MSFTNGP04.phx.gbl...
> | Thanks for reminding me. Yes, the default is to *not* include files
> with H
> | and/or S attributes. Always has been thus with the DIR command. To get
> all
> | of them, you need to do one search w/o any attributes included, then
> one for
> | H-only, then one for S-only, and finally one for H+S.
>
> I'm no perfect expert in DOS. Actually, though, I find "/a" alone will
> display all files regardless of attributes. "DIR /s /a" goes into every

> folder- EXCEPT for FOLDERS that are themselves attributed System or

PCR

unread,
Nov 7, 2006, 12:19:00 AM11/7/06
to
"Gary S. Terhune" <grys...@mvps.org> wrote in message
news:OhQEKpg...@TK2MSFTNGP02.phx.gbl...

| Another cool trick. Learn something every day. So the /A switch
includes all
| attributes, which effectively includes all files. But you can't get
into
| Hidden+System subfolders? Something to remember.

That is correct. /A =all attributes. And /S, even with /a, will not
rnter an H or S folder, not using the DIR command, anyhow.

| Oh well, it's a klutzy way to do what the OP wants, anyway. I think a
| third-party utility is called for. There's an interesting freeware
offering
| here:
| http://www.jam-software.com/freeware/index.shtml
|
| Near the bottom of the page, FileList V1.5
| http://www.jam-software.com/freeware/FileList.zip
|
| "FileList is a command line utility that produces a list of files of
the
| given path in the CSV format, which can be imported in a spreadsheet
or
| database. The list includes the file name, the size, the path, the
file
| extension, the owner of the file (only Windows NT/2000/XP) as well as
the
| last access and change date and the creation date of the file.
Optionally
| the author of MS Office documents can be displayed."

Yea, that's a better approach. Alternatively, familiarize yourself with
your H & S folders &/or decide you don't care what's in those, anyhow.

"Its", I guess I meant— not "it's"! OK, bye.

Franc Zabkar

unread,
Nov 9, 2006, 1:25:28 AM11/9/06
to
On Mon, 6 Nov 2006 17:10:30 -0800, "Gary S. Terhune"
<grys...@mvps.org> put finger to keyboard and composed:

>That will not do what's asked, Don. All you get is a shortcut thingy that
>repeats the search, not a results file like OP wants.

Your answer is a bit ambiguous. The desktop shortcut can point to a
.fnd file that contains either the *parameters* for the search or the
*results* of the last search. You're right, however, in that the
format of the results file is not what the OP is looking for.

>
>Gary S. Terhune
>MS-MVP Shell/User
>http://grystmill.org/articles/cleanboot.htm
>http://grystmill.org/articles/security.htm
>
>
>"Don Phillipson" <d.phillips...@rogers.com> wrote in message
>news:e2VYLeFA...@TK2MSFTNGP04.phx.gbl...
>> "Phil James" <james...@alum.mit.edu> wrote in message
>> news:uc6YnHFA...@TK2MSFTNGP02.phx.gbl...
>>>
>>> If you use the "find" search system under "start," you get a list of
>> files.
>>> How can that list be exported to an Excel spreadsheet? ...or printed
>>> out?
>>
>> Make use of
>> / Options / Save Results
>> (and provide a TXT or all-ASCII filename.)
>>
>> Don Phillipson
>> Carlsbad Springs
>> (Ottawa, Canada)

- Franc Zabkar
--
Please remove one 'i' from my address when replying by email.

Gary S. Terhune

unread,
Nov 9, 2006, 1:40:08 AM11/9/06
to
Yeah, I wasn't exactly complete in the previous. File>Save Search saves the
results, but not in a usable format. IIRC, Options>Save Search is the one
that just saves parameters, but danged if I can recall how to retrieve that.
There isn't any file modified or created when I do a Find with that enabled.
Registry? And if so, how is it retrieved?

--

"Franc Zabkar" <fza...@iinternode.on.net> wrote in message
news:ii05l2di2dgn4kp3u...@4ax.com...

Franc Zabkar

unread,
Nov 9, 2006, 4:28:23 PM11/9/06
to
On Wed, 8 Nov 2006 22:40:08 -0800, "Gary S. Terhune"

<grys...@mvps.org> put finger to keyboard and composed:

>Yeah, I wasn't exactly complete in the previous. File>Save Search saves the

>results, but not in a usable format. IIRC, Options>Save Search is the one
>that just saves parameters, but danged if I can recall how to retrieve that.
>There isn't any file modified or created when I do a Find with that enabled.
>Registry? And if so, how is it retrieved?

In my case both methods generate .fnd files on my desktop.

Gary S. Terhune

unread,
Nov 9, 2006, 4:46:07 PM11/9/06
to
I thought so! That's what I got when I played with it last week. Only this
98 installation on a VPC isn't producing a FND file when I use the
Options>Save Results method. So that is the method that saves results, not
just parameters? Because the File>Save Search method just saves parameters
on this one. And am I right that the one that stores results isn't amenable
to porting into some other database? Haven't really looked at it closely
(obviously, <s>.)

--

Gary S. Terhune
MS-MVP Shell/User

http://grystmill.com/articles/cleanboot.htm
http://grystmill.com/articles/security.htm

"Franc Zabkar" <fza...@iinternode.on.net> wrote in message

news:9677l2ho2didti4fa...@4ax.com...

Franc Zabkar

unread,
Nov 10, 2006, 11:14:33 PM11/10/06
to
On Thu, 9 Nov 2006 13:46:07 -0800, "Gary S. Terhune"

<grys...@mvps.org> put finger to keyboard and composed:

>I thought so! That's what I got when I played with it last week. Only this

>98 installation on a VPC isn't producing a FND file when I use the
>Options>Save Results method. So that is the method that saves results, not
>just parameters? Because the File>Save Search method just saves parameters
>on this one.

In my case File -> Save Search always saves the search parameters. It
also saves the search results if Options -> Save Results is ticked.
Merely ticking the latter option does not perform a save, the save is
actually performed when you click on File -> Save Search.

>And am I right that the one that stores results isn't amenable
>to porting into some other database?

That's what I'm seeing as well.

>Haven't really looked at it closely (obviously, <s>.)

>Gary S. Terhune
>MS-MVP Shell/User

- Franc Zabkar

Gary S. Terhune

unread,
Nov 11, 2006, 1:25:46 AM11/11/06
to
Ahhh.... OK, got it, <s>. Of course, with the way my mind resembles Swiss
cheese these days, you'll have to remind me again next time it comes up,
<s>.

Looking at that file in PT, though, I'm betting it *would* be possible to
parse it out using VBScript and convert it to a CSV file suitable for import
into Excel -- maybe... At least, when my mind worked properly, I might have
been able to. Don't think I'd be up to it these days, though.

--

Gary S. Terhune
MS-MVP Shell/User

http://grystmill.com/articles/cleanboot.htm
http://grystmill.com/articles/security.htm

"Franc Zabkar" <fza...@iinternode.on.net> wrote in message

news:r9jal2pb6noihtavf...@4ax.com...

0 new messages