sending the result of a search operation to a flat file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I have a need where the result of a search operation for all files with a
particular extension on a particular drive need to be saved to a file.

I can do this by screen capture but that does not meet my need.

I need to save the individual entries , their locations and time stamps to
Excel/ CSV file.

Is there a way to do this.

Thanks
Naveen
 
Naveen said:
Hello

I have a need where the result of a search operation for all files with a
particular extension on a particular drive need to be saved to a file.

I can do this by screen capture but that does not meet my need.

I need to save the individual entries , their locations and time stamps to
Excel/ CSV file.

Is there a way to do this.


Here is one way:

From the Command Prompt, go to the folder where the files are
residing. Type in a command, such as:

dir e:\msoffice\*.xls >c:\excelsearch.txt

In this example, one is asking for a printout of all files with
the *.xls extension in the msoffice folder to be delivered to a
file named excelsearch.txt.

Next, open excelsearch.txt with Notepad and strip away the
folder. Finally, open excelsearch.txt with Excel and parse
for each column. Save the final result as an Excel file.

Give it a try and play around with it.
 
Naveen said:
Hello

I have a need where the result of a search operation for all files with a
particular extension on a particular drive need to be saved to a file.

I can do this by screen capture but that does not meet my need.

I need to save the individual entries , their locations and time stamps to
Excel/ CSV file.

Is there a way to do this.

Thanks
Naveen

Try a batch file like this:

[1]@echo off
[2]if exist mystery.csv del mystery.csv
[3]for /f %%i in (c:\pathto\filemask.ext) do echo "%%~nxi","%%~dpi","%%~ti"[4]if exist mystery.csv mystery.csv

Each line begins [number]. Lines will be wrapped in transmission and need to
be rejoined. The [number] at the beginning of each line needs to be removed.

I'm assuming that by "individual entries" you mean "filenames and
extensions" - had you given some examples, a better solution might be
constructed.

Line [4] should execute EXCEL on MYSTERY.CSV if MYSTERY.CSV exists AND has
..CSV has been associated with EXCEL = otherwise, simply execute EXCEL with
argument MYSTERY.CSV

HTH

....Bill
 
EXCELLENT. This tool fits my requirements to a T. THANKS A LOT!

My thanks and appreciation to others who responded as well, your time on
this is recognized.

Regards
Naveen
 
Even a blind pig finds a truffle, now and again ... ;-)

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
Back
Top