Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
best way to find
Hi;
I need to look up 1800+ items in over 600+ files. items are listed in .txt format files are in excel format. I would rather not have to open/close the excel files.. (takes too long) 1) Is there a way to look these 1800 items up? 2) What is the best way to store the results.. in Excel, Txt or other.. I know I can shell to the cmd.exe and do find or findstr command string.. But doing this brings bad results. All I need is the file names that contain the search string (item) Does anyone have any ideas and sample code... Thanks in advance for your time... VB = 6.3 Office = 2003 XP |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
best way to find
I'm a bit confused, because although Excel can open open .txt files, they
are not Excel files. You can use ADO to query the files, if they have database structure. But you write "All I need is the file names", so can you use Dir() ? NickHK "Sam Hodo" ... Hi; I need to look up 1800+ items in over 600+ files. items are listed in .txt format files are in excel format. I would rather not have to open/close the excel files.. (takes too long) 1) Is there a way to look these 1800 items up? 2) What is the best way to store the results.. in Excel, Txt or other.. I know I can shell to the cmd.exe and do find or findstr command string.. But doing this brings bad results. All I need is the file names that contain the search string (item) Does anyone have any ideas and sample code... Thanks in advance for your time... VB = 6.3 Office = 2003 XP |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
best way to find
Look at the file Search object. It supports the functionality of the file
=open dialog when you select tools at the top and then select Search -- Regards, Tom Ogilvy "Sam Hodo" wrote: Hi; I need to look up 1800+ items in over 600+ files. items are listed in .txt format files are in excel format. I would rather not have to open/close the excel files.. (takes too long) 1) Is there a way to look these 1800 items up? 2) What is the best way to store the results.. in Excel, Txt or other.. I know I can shell to the cmd.exe and do find or findstr command string.. But doing this brings bad results. All I need is the file names that contain the search string (item) Does anyone have any ideas and sample code... Thanks in advance for your time... VB = 6.3 Office = 2003 XP |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
best way to find
Hi NickHK;
I wrote a VB script that shells cmd.exe /c command string the searchstring is dir /s /b c:\directory\*.exe |findstr /i "searchstring" ouutput.txt code I use is.. Dim RetVal RetVal = Shell("C:\WINDOWS\SYSTEM32\CMD.EXE /C" + searchstring, 0) when I execute this, it runs ok; but the resulting files created have bogus data. I am looking for a better way to gather data that is not bogus. Thank for your help "NickHK" wrote: I'm a bit confused, because although Excel can open open .txt files, they are not Excel files. You can use ADO to query the files, if they have database structure. But you write "All I need is the file names", so can you use Dir() ? NickHK "Sam Hodo" ... Hi; I need to look up 1800+ items in over 600+ files. items are listed in .txt format files are in excel format. I would rather not have to open/close the excel files.. (takes too long) 1) Is there a way to look these 1800 items up? 2) What is the best way to store the results.. in Excel, Txt or other.. I know I can shell to the cmd.exe and do find or findstr command string.. But doing this brings bad results. All I need is the file names that contain the search string (item) Does anyone have any ideas and sample code... Thanks in advance for your time... VB = 6.3 Office = 2003 XP |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
best way to find
Sam,
Try a Dir() with ADO so you do not have to open each file in Excel. Otherwis the bogus results are not an Excel issue. NickHK "Sam Hodo" ... Hi NickHK; I wrote a VB script that shells cmd.exe /c command string the searchstring is dir /s /b c:\directory\*.exe |findstr /i "searchstring" ouutput.txt code I use is.. Dim RetVal RetVal = Shell("C:\WINDOWS\SYSTEM32\CMD.EXE /C" + searchstring, 0) when I execute this, it runs ok; but the resulting files created have bogus data. I am looking for a better way to gather data that is not bogus. Thank for your help "NickHK" wrote: I'm a bit confused, because although Excel can open open .txt files, they are not Excel files. You can use ADO to query the files, if they have database structure. But you write "All I need is the file names", so can you use Dir() ? NickHK "Sam Hodo" ... Hi; I need to look up 1800+ items in over 600+ files. items are listed in .txt format files are in excel format. I would rather not have to open/close the excel files.. (takes too long) 1) Is there a way to look these 1800 items up? 2) What is the best way to store the results.. in Excel, Txt or other.. I know I can shell to the cmd.exe and do find or findstr command string.. But doing this brings bad results. All I need is the file names that contain the search string (item) Does anyone have any ideas and sample code... Thanks in advance for your time... VB = 6.3 Office = 2003 XP |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
best way to find
Hi NickHK;
Please explain ADO.. thanks; "NickHK" wrote: Sam, Try a Dir() with ADO so you do not have to open each file in Excel. Otherwis the bogus results are not an Excel issue. NickHK "Sam Hodo" ... Hi NickHK; I wrote a VB script that shells cmd.exe /c command string the searchstring is dir /s /b c:\directory\*.exe |findstr /i "searchstring" ouutput.txt code I use is.. Dim RetVal RetVal = Shell("C:\WINDOWS\SYSTEM32\CMD.EXE /C" + searchstring, 0) when I execute this, it runs ok; but the resulting files created have bogus data. I am looking for a better way to gather data that is not bogus. Thank for your help "NickHK" wrote: I'm a bit confused, because although Excel can open open .txt files, they are not Excel files. You can use ADO to query the files, if they have database structure. But you write "All I need is the file names", so can you use Dir() ? NickHK "Sam Hodo" ... Hi; I need to look up 1800+ items in over 600+ files. items are listed in .txt format files are in excel format. I would rather not have to open/close the excel files.. (takes too long) 1) Is there a way to look these 1800 items up? 2) What is the best way to store the results.. in Excel, Txt or other.. I know I can shell to the cmd.exe and do find or findstr command string.. But doing this brings bad results. All I need is the file names that contain the search string (item) Does anyone have any ideas and sample code... Thanks in advance for your time... VB = 6.3 Office = 2003 XP |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
best way to find
ADO= Microsoft Active Data Objects 2.x
Basically, it enables you to query (using SQL syntax) an Excel (and other formats) file, without having to "open" the file. But the files need to be in a database structure, otherwise the results are unpredictable.. NickHK "Sam Hodo" ... Hi NickHK; Please explain ADO.. thanks; "NickHK" wrote: Sam, Try a Dir() with ADO so you do not have to open each file in Excel. Otherwis the bogus results are not an Excel issue. NickHK "Sam Hodo" ... Hi NickHK; I wrote a VB script that shells cmd.exe /c command string the searchstring is dir /s /b c:\directory\*.exe |findstr /i "searchstring" ouutput.txt code I use is.. Dim RetVal RetVal = Shell("C:\WINDOWS\SYSTEM32\CMD.EXE /C" + searchstring, 0) when I execute this, it runs ok; but the resulting files created have bogus data. I am looking for a better way to gather data that is not bogus. Thank for your help "NickHK" wrote: I'm a bit confused, because although Excel can open open .txt files, they are not Excel files. You can use ADO to query the files, if they have database structure. But you write "All I need is the file names", so can you use Dir() ? NickHK "Sam Hodo" ... Hi; I need to look up 1800+ items in over 600+ files. items are listed in .txt format files are in excel format. I would rather not have to open/close the excel files.. (takes too long) 1) Is there a way to look these 1800 items up? 2) What is the best way to store the results.. in Excel, Txt or other.. I know I can shell to the cmd.exe and do find or findstr command string.. But doing this brings bad results. All I need is the file names that contain the search string (item) Does anyone have any ideas and sample code... Thanks in advance for your time... VB = 6.3 Office = 2003 XP |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
best way to find
without having to "open" the file
should probably be without having to "open" the file in Excel <g -- Regards, Tom Ogilvy "NickHK" wrote: ADO= Microsoft Active Data Objects 2.x Basically, it enables you to query (using SQL syntax) an Excel (and other formats) file, without having to "open" the file. But the files need to be in a database structure, otherwise the results are unpredictable.. NickHK "Sam Hodo" ... Hi NickHK; Please explain ADO.. thanks; "NickHK" wrote: Sam, Try a Dir() with ADO so you do not have to open each file in Excel. Otherwis the bogus results are not an Excel issue. NickHK "Sam Hodo" ... Hi NickHK; I wrote a VB script that shells cmd.exe /c command string the searchstring is dir /s /b c:\directory\*.exe |findstr /i "searchstring" ouutput.txt code I use is.. Dim RetVal RetVal = Shell("C:\WINDOWS\SYSTEM32\CMD.EXE /C" + searchstring, 0) when I execute this, it runs ok; but the resulting files created have bogus data. I am looking for a better way to gather data that is not bogus. Thank for your help "NickHK" wrote: I'm a bit confused, because although Excel can open open .txt files, they are not Excel files. You can use ADO to query the files, if they have database structure. But you write "All I need is the file names", so can you use Dir() ? NickHK "Sam Hodo" ... Hi; I need to look up 1800+ items in over 600+ files. items are listed in .txt format files are in excel format. I would rather not have to open/close the excel files.. (takes too long) 1) Is there a way to look these 1800 items up? 2) What is the best way to store the results.. in Excel, Txt or other.. I know I can shell to the cmd.exe and do find or findstr command string.. But doing this brings bad results. All I need is the file names that contain the search string (item) Does anyone have any ideas and sample code... Thanks in advance for your time... VB = 6.3 Office = 2003 XP |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
best way to find
Tom,
I was hoping that the "" would be be noticed. Just to try to differentiate from this method and Automation. <g NickHK "Tom Ogilvy" ... without having to "open" the file should probably be without having to "open" the file in Excel <g -- Regards, Tom Ogilvy "NickHK" wrote: ADO= Microsoft Active Data Objects 2.x Basically, it enables you to query (using SQL syntax) an Excel (and other formats) file, without having to "open" the file. But the files need to be in a database structure, otherwise the results are unpredictable.. NickHK "Sam Hodo" ... Hi NickHK; Please explain ADO.. thanks; "NickHK" wrote: Sam, Try a Dir() with ADO so you do not have to open each file in Excel. Otherwis the bogus results are not an Excel issue. NickHK "Sam Hodo" ... Hi NickHK; I wrote a VB script that shells cmd.exe /c command string the searchstring is dir /s /b c:\directory\*.exe |findstr /i "searchstring" ouutput.txt code I use is.. Dim RetVal RetVal = Shell("C:\WINDOWS\SYSTEM32\CMD.EXE /C" + searchstring, 0) when I execute this, it runs ok; but the resulting files created have bogus data. I am looking for a better way to gather data that is not bogus. Thank for your help "NickHK" wrote: I'm a bit confused, because although Excel can open open .txt files, they are not Excel files. You can use ADO to query the files, if they have database structure. But you write "All I need is the file names", so can you use Dir() ? NickHK "Sam Hodo" ... Hi; I need to look up 1800+ items in over 600+ files. items are listed in .txt format files are in excel format. I would rather not have to open/close the excel files.. (takes too long) 1) Is there a way to look these 1800 items up? 2) What is the best way to store the results.. in Excel, Txt or other.. I know I can shell to the cmd.exe and do find or findstr command string.. But doing this brings bad results. All I need is the file names that contain the search string (item) Does anyone have any ideas and sample code... Thanks in advance for your time... VB = 6.3 Office = 2003 XP |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
best way to find
Hi;
One last question... How do I tell the shell not to open more than 1 cmd.exe session at a time.. I have about 30 cmd.exe sessions running at one time.. I know this can not be a good thing... thanks "NickHK" wrote: Tom, I was hoping that the "" would be be noticed. Just to try to differentiate from this method and Automation. <g NickHK "Tom Ogilvy" ... without having to "open" the file should probably be without having to "open" the file in Excel <g -- Regards, Tom Ogilvy "NickHK" wrote: ADO= Microsoft Active Data Objects 2.x Basically, it enables you to query (using SQL syntax) an Excel (and other formats) file, without having to "open" the file. But the files need to be in a database structure, otherwise the results are unpredictable.. NickHK "Sam Hodo" ... Hi NickHK; Please explain ADO.. thanks; "NickHK" wrote: Sam, Try a Dir() with ADO so you do not have to open each file in Excel. Otherwis the bogus results are not an Excel issue. NickHK "Sam Hodo" ... Hi NickHK; I wrote a VB script that shells cmd.exe /c command string the searchstring is dir /s /b c:\directory\*.exe |findstr /i "searchstring" ouutput.txt code I use is.. Dim RetVal RetVal = Shell("C:\WINDOWS\SYSTEM32\CMD.EXE /C" + searchstring, 0) when I execute this, it runs ok; but the resulting files created have bogus data. I am looking for a better way to gather data that is not bogus. Thank for your help "NickHK" wrote: I'm a bit confused, because although Excel can open open .txt files, they are not Excel files. You can use ADO to query the files, if they have database structure. But you write "All I need is the file names", so can you use Dir() ? NickHK "Sam Hodo" ... Hi; I need to look up 1800+ items in over 600+ files. items are listed in .txt format files are in excel format. I would rather not have to open/close the excel files.. (takes too long) 1) Is there a way to look these 1800 items up? 2) What is the best way to store the results.. in Excel, Txt or other.. I know I can shell to the cmd.exe and do find or findstr command string.. But doing this brings bad results. All I need is the file names that contain the search string (item) Does anyone have any ideas and sample code... Thanks in advance for your time... VB = 6.3 Office = 2003 XP |
#11
Posted to microsoft.public.excel.programming
|
|||
|
|||
best way to find
"Sam Hodo" ... Hi; One last question... How do I tell the shell not to open more than 1 cmd.exe session at a time.. I have about 30 cmd.exe sessions running at one time.. I know this can not be a good thing... thanks "NickHK" wrote: Tom, I was hoping that the "" would be be noticed. Just to try to differentiate from this method and Automation. <g NickHK "Tom Ogilvy" ... without having to "open" the file should probably be without having to "open" the file in Excel <g -- Regards, Tom Ogilvy "NickHK" wrote: ADO= Microsoft Active Data Objects 2.x Basically, it enables you to query (using SQL syntax) an Excel (and other formats) file, without having to "open" the file. But the files need to be in a database structure, otherwise the results are unpredictable.. NickHK "Sam Hodo" ... Hi NickHK; Please explain ADO.. thanks; "NickHK" wrote: Sam, Try a Dir() with ADO so you do not have to open each file in Excel. Otherwis the bogus results are not an Excel issue. NickHK "Sam Hodo" ... Hi NickHK; I wrote a VB script that shells cmd.exe /c command string the searchstring is dir /s /b c:\directory\*.exe |findstr /i "searchstring" ouutput.txt code I use is.. Dim RetVal RetVal = Shell("C:\WINDOWS\SYSTEM32\CMD.EXE /C" + searchstring, 0) when I execute this, it runs ok; but the resulting files created have bogus data. I am looking for a better way to gather data that is not bogus. Thank for your help "NickHK" wrote: I'm a bit confused, because although Excel can open open .txt files, they are not Excel files. You can use ADO to query the files, if they have database structure. But you write "All I need is the file names", so can you use Dir() ? NickHK "Sam Hodo" ... Hi; I need to look up 1800+ items in over 600+ files. items are listed in .txt format files are in excel format. I would rather not have to open/close the excel files.. (takes too long) 1) Is there a way to look these 1800 items up? 2) What is the best way to store the results.. in Excel, Txt or other.. I know I can shell to the cmd.exe and do find or findstr command string.. But doing this brings bad results. All I need is the file names that contain the search string (item) Does anyone have any ideas and sample code... Thanks in advance for your time... VB = 6.3 Office = 2003 XP |
#12
Posted to microsoft.public.excel.programming
|
|||
|
|||
best way to find
Sam.
Whilst this may be possible from Excel, it is a Windows question. NicxkHK "Sam Hodo" ... Hi; One last question... How do I tell the shell not to open more than 1 cmd.exe session at a time.. I have about 30 cmd.exe sessions running at one time.. I know this can not be a good thing... thanks "NickHK" wrote: Tom, I was hoping that the "" would be be noticed. Just to try to differentiate from this method and Automation. <g NickHK "Tom Ogilvy" ... without having to "open" the file should probably be without having to "open" the file in Excel <g -- Regards, Tom Ogilvy "NickHK" wrote: ADO= Microsoft Active Data Objects 2.x Basically, it enables you to query (using SQL syntax) an Excel (and other formats) file, without having to "open" the file. But the files need to be in a database structure, otherwise the results are unpredictable.. NickHK "Sam Hodo" ... Hi NickHK; Please explain ADO.. thanks; "NickHK" wrote: Sam, Try a Dir() with ADO so you do not have to open each file in Excel. Otherwis the bogus results are not an Excel issue. NickHK "Sam Hodo" ... Hi NickHK; I wrote a VB script that shells cmd.exe /c command string the searchstring is dir /s /b c:\directory\*.exe |findstr /i "searchstring" ouutput.txt code I use is.. Dim RetVal RetVal = Shell("C:\WINDOWS\SYSTEM32\CMD.EXE /C" + searchstring, 0) when I execute this, it runs ok; but the resulting files created have bogus data. I am looking for a better way to gather data that is not bogus. Thank for your help "NickHK" wrote: I'm a bit confused, because although Excel can open open .txt files, they are not Excel files. You can use ADO to query the files, if they have database structure. But you write "All I need is the file names", so can you use Dir() ? NickHK "Sam Hodo" ... Hi; I need to look up 1800+ items in over 600+ files. items are listed in .txt format files are in excel format. I would rather not have to open/close the excel files.. (takes too long) 1) Is there a way to look these 1800 items up? 2) What is the best way to store the results.. in Excel, Txt or other.. I know I can shell to the cmd.exe and do find or findstr command string.. But doing this brings bad results. All I need is the file names that contain the search string (item) Does anyone have any ideas and sample code... Thanks in advance for your time... VB = 6.3 Office = 2003 XP |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find First Non blank cell than find column header and return that value | Excel Worksheet Functions | |||
Despite data existing in Excel 2002 spreadsheet Find doesn't find | Excel Discussion (Misc queries) | |||
find and delete duplicate entries in two columns or find and prin. | Excel Programming | |||
find and delete text, find a 10-digit number and put it in a textbox | Excel Programming | |||
backwards find function to find character in a string of text | Excel Programming |