Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Move names from Search to Excel

I did a search in windows explorer for all files that contain the text "X".
I want to be able to move the list of named files to an excel worksheet. In
other words, if my search results displayed these files containing the text
"X":
ABCD
EFGH
IJKLM

I want my Excel spreadsheet to look like this:
ABCD
EFGH
IJKLM

Thanks for the help!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default Move names from Search to Excel

Maybe this quick non-vba solution?
(it's a lot easier to do than to describe)

Open notepad and enter a line similar to this:
dir/b \\MyServer\MyFolder\*X*.xl* c:\MyFileList.txt

Save the notepad file on your Desktop as ListFiles.BAT

Double-click that file to run it and create the list

Open the C:\MyFileList.txt file and copy the list into Excel
or just import it into Excel

-----------------
Notes:
dir/b :is the command to list files (excluding headings, details, and
summaries)

\\MyServer\MyFolder\*X*.xl* :indicates where to look and what to list.
In this case, it looks in the MyFolder folder of the MyServer server for
Excel files whose file name contains an "X". You'll enter the correct
location. If you are searching your C:drive, you'd use this version of the
command:
dir/b C:\MyFolder\*X*.xl* c:\MyFileList.txt

This section: c:\MyFileList.txt
is the command to write the search results to a text file named
MyFileList.txt and store that file in the root of the C: drive.
-----------------


Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"Mark1" wrote:

I did a search in windows explorer for all files that contain the text "X".
I want to be able to move the list of named files to an excel worksheet. In
other words, if my search results displayed these files containing the text
"X":
ABCD
EFGH
IJKLM

I want my Excel spreadsheet to look like this:
ABCD
EFGH
IJKLM

Thanks for the help!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Move names from Search to Excel

Thank you Ron, that is exactly what I needed. I was going through DOS help
webpages trying to find the exact syntax. Thanks again!

"Ron Coderre" wrote:

Maybe this quick non-vba solution?
(it's a lot easier to do than to describe)

Open notepad and enter a line similar to this:
dir/b \\MyServer\MyFolder\*X*.xl* c:\MyFileList.txt

Save the notepad file on your Desktop as ListFiles.BAT

Double-click that file to run it and create the list

Open the C:\MyFileList.txt file and copy the list into Excel
or just import it into Excel

-----------------
Notes:
dir/b :is the command to list files (excluding headings, details, and
summaries)

\\MyServer\MyFolder\*X*.xl* :indicates where to look and what to list.
In this case, it looks in the MyFolder folder of the MyServer server for
Excel files whose file name contains an "X". You'll enter the correct
location. If you are searching your C:drive, you'd use this version of the
command:
dir/b C:\MyFolder\*X*.xl* c:\MyFileList.txt

This section: c:\MyFileList.txt
is the command to write the search results to a text file named
MyFileList.txt and store that file in the root of the C: drive.
-----------------


Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"Mark1" wrote:

I did a search in windows explorer for all files that contain the text "X".
I want to be able to move the list of named files to an excel worksheet. In
other words, if my search results displayed these files containing the text
"X":
ABCD
EFGH
IJKLM

I want my Excel spreadsheet to look like this:
ABCD
EFGH
IJKLM

Thanks for the help!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default Move names from Search to Excel

You're very welcome...Thanks for the feedback.

(It's not often that I have to sort through my mind's seldom used DOS closet
looking for not quite forgotten commands!)

***********
Regards,
Ron

XL2002, WinXP


"Mark1" wrote:

Thank you Ron, that is exactly what I needed. I was going through DOS help
webpages trying to find the exact syntax. Thanks again!

"Ron Coderre" wrote:

Maybe this quick non-vba solution?
(it's a lot easier to do than to describe)

Open notepad and enter a line similar to this:
dir/b \\MyServer\MyFolder\*X*.xl* c:\MyFileList.txt

Save the notepad file on your Desktop as ListFiles.BAT

Double-click that file to run it and create the list

Open the C:\MyFileList.txt file and copy the list into Excel
or just import it into Excel

-----------------
Notes:
dir/b :is the command to list files (excluding headings, details, and
summaries)

\\MyServer\MyFolder\*X*.xl* :indicates where to look and what to list.
In this case, it looks in the MyFolder folder of the MyServer server for
Excel files whose file name contains an "X". You'll enter the correct
location. If you are searching your C:drive, you'd use this version of the
command:
dir/b C:\MyFolder\*X*.xl* c:\MyFileList.txt

This section: c:\MyFileList.txt
is the command to write the search results to a text file named
MyFileList.txt and store that file in the root of the C: drive.
-----------------


Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"Mark1" wrote:

I did a search in windows explorer for all files that contain the text "X".
I want to be able to move the list of named files to an excel worksheet. In
other words, if my search results displayed these files containing the text
"X":
ABCD
EFGH
IJKLM

I want my Excel spreadsheet to look like this:
ABCD
EFGH
IJKLM

Thanks for the help!

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Move names from Search to Excel

Ron,
One more thing, and it might be a biggie. I need to list out files where
the contents contain "X", not the actual file name. This is what I tried
before your original reply:

C:\FINDSTR /M "X*" \\MYSERVER\MYPATH

but with no luck. I'm going to try to incorporate what you wrote earlier
and see what I get. In the meantime, if you have the modification that would
be great.


"Ron Coderre" wrote:

You're very welcome...Thanks for the feedback.

(It's not often that I have to sort through my mind's seldom used DOS closet
looking for not quite forgotten commands!)

***********
Regards,
Ron

XL2002, WinXP


"Mark1" wrote:

Thank you Ron, that is exactly what I needed. I was going through DOS help
webpages trying to find the exact syntax. Thanks again!

"Ron Coderre" wrote:

Maybe this quick non-vba solution?
(it's a lot easier to do than to describe)

Open notepad and enter a line similar to this:
dir/b \\MyServer\MyFolder\*X*.xl* c:\MyFileList.txt

Save the notepad file on your Desktop as ListFiles.BAT

Double-click that file to run it and create the list

Open the C:\MyFileList.txt file and copy the list into Excel
or just import it into Excel

-----------------
Notes:
dir/b :is the command to list files (excluding headings, details, and
summaries)

\\MyServer\MyFolder\*X*.xl* :indicates where to look and what to list.
In this case, it looks in the MyFolder folder of the MyServer server for
Excel files whose file name contains an "X". You'll enter the correct
location. If you are searching your C:drive, you'd use this version of the
command:
dir/b C:\MyFolder\*X*.xl* c:\MyFileList.txt

This section: c:\MyFileList.txt
is the command to write the search results to a text file named
MyFileList.txt and store that file in the root of the C: drive.
-----------------


Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"Mark1" wrote:

I did a search in windows explorer for all files that contain the text "X".
I want to be able to move the list of named files to an excel worksheet. In
other words, if my search results displayed these files containing the text
"X":
ABCD
EFGH
IJKLM

I want my Excel spreadsheet to look like this:
ABCD
EFGH
IJKLM

Thanks for the help!



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default Move names from Search to Excel

Regarding: FINDSTR /M "X*" \\MYSERVER\MYPATH

If you intend the asterisk to be a wildcard...that's the wrong wildcard.
You'd need to create a regular expression for the search.

FINDSTR /M "X" \\MYSERVER\MYPATH
will find files that contain "X"

Also, from my playing with the FINDSTR command....
To find files with lines that begin with "X"...use:
FINDSTR /M/B "X" \\MYSERVER\MYPATH

However, if you're doing that search in Excel files, they're not constructed
like a plain text file. So, finding the beginning of a line may be an issue.
Example:
1) I built an Excel file that only contained "applejacks" in cell A1 and
saved the file as C:\DeleteMe.xls
2) I searched: FINDSTR /B "APPLE" C:\*.XLS
---result: no match
3) I searched: FINDSTR "APPLE" C:\*.XLS
--result: c:\deleteme.xls:...applejacks

Use this command to see a list of all FINDSTR parameters and syntax:
FINDSTR /?

I hope that helps.
***********
Regards,
Ron

XL2002, WinXP


"Mark1" wrote:

Ron,
One more thing, and it might be a biggie. I need to list out files where
the contents contain "X", not the actual file name. This is what I tried
before your original reply:

C:\FINDSTR /M "X*" \\MYSERVER\MYPATH

but with no luck. I'm going to try to incorporate what you wrote earlier
and see what I get. In the meantime, if you have the modification that would
be great.


"Ron Coderre" wrote:

You're very welcome...Thanks for the feedback.

(It's not often that I have to sort through my mind's seldom used DOS closet
looking for not quite forgotten commands!)

***********
Regards,
Ron

XL2002, WinXP


"Mark1" wrote:

Thank you Ron, that is exactly what I needed. I was going through DOS help
webpages trying to find the exact syntax. Thanks again!

"Ron Coderre" wrote:

Maybe this quick non-vba solution?
(it's a lot easier to do than to describe)

Open notepad and enter a line similar to this:
dir/b \\MyServer\MyFolder\*X*.xl* c:\MyFileList.txt

Save the notepad file on your Desktop as ListFiles.BAT

Double-click that file to run it and create the list

Open the C:\MyFileList.txt file and copy the list into Excel
or just import it into Excel

-----------------
Notes:
dir/b :is the command to list files (excluding headings, details, and
summaries)

\\MyServer\MyFolder\*X*.xl* :indicates where to look and what to list.
In this case, it looks in the MyFolder folder of the MyServer server for
Excel files whose file name contains an "X". You'll enter the correct
location. If you are searching your C:drive, you'd use this version of the
command:
dir/b C:\MyFolder\*X*.xl* c:\MyFileList.txt

This section: c:\MyFileList.txt
is the command to write the search results to a text file named
MyFileList.txt and store that file in the root of the C: drive.
-----------------


Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"Mark1" wrote:

I did a search in windows explorer for all files that contain the text "X".
I want to be able to move the list of named files to an excel worksheet. In
other words, if my search results displayed these files containing the text
"X":
ABCD
EFGH
IJKLM

I want my Excel spreadsheet to look like this:
ABCD
EFGH
IJKLM

Thanks for the help!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a shortcut key to move between sheets in Excel? Josh Craig Excel Discussion (Misc queries) 4 May 8th 08 04:36 PM
create a random list of names from a list of names in EXCEL Givvie Excel Worksheet Functions 2 October 23rd 06 05:10 AM
Excel 2003 - When I open files, why are some file names blue? Formula One Excel Discussion (Misc queries) 2 August 17th 06 05:58 PM
Running Excel 2000 VBA Application on Excel 2003 Excel Worksheet Functions 0 August 8th 06 06:04 PM
command button in excel will move when print. [email protected] Excel Discussion (Misc queries) 1 December 29th 04 03:53 PM


All times are GMT +1. The time now is 12:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"