Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default 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
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
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
Despite data existing in Excel 2002 spreadsheet Find doesn't find AnnieB Excel Discussion (Misc queries) 1 June 16th 06 02:15 AM
find and delete duplicate entries in two columns or find and prin. campare 2 columns of numbers-find unique Excel Programming 1 November 24th 04 04:09 PM
find and delete text, find a 10-digit number and put it in a textbox Paul Excel Programming 3 November 16th 04 04:21 PM
backwards find function to find character in a string of text Ashleigh K. Excel Programming 1 January 14th 04 04:36 PM


All times are GMT +1. The time now is 03:21 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"