Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Is there a shortcut key to move between sheets in Excel? | Excel Discussion (Misc queries) | |||
create a random list of names from a list of names in EXCEL | Excel Worksheet Functions | |||
Excel 2003 - When I open files, why are some file names blue? | Excel Discussion (Misc queries) | |||
Running Excel 2000 VBA Application on Excel 2003 | Excel Worksheet Functions | |||
command button in excel will move when print. | Excel Discussion (Misc queries) |