ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   best way to find (https://www.excelbanter.com/excel-programming/374022-best-way-find.html)

Sam Hodo

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



NickHK[_3_]

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





Tom Ogilvy

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



Sam Hodo

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






NickHK[_3_]

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








Sam Hodo

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









NickHK[_3_]

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











Tom Ogilvy

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












NickHK[_3_]

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














Sam Hodo

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















NickHK[_3_]

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

















NickHK[_3_]

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


















All times are GMT +1. The time now is 01:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com