Reading a batch files 
Author Message
 Reading a batch files

Hi,

I am trying to open the content of files ( more than one) in VBA, which
function or method I should look for in order to do so?  I don't mind if it
is using "drag and drop" or "Open Dialogue box" to select multi-files.

Thanks



Sun, 30 Jan 2005 15:24:29 GMT  
 Reading a batch files
There's code, contributed by Ken Getz, to use the Windows
Common Dialog API directly, to obtain a file name in the API
section of http://www.mvps.org/access. I don't exactly
understand what you mean by "open the content of files (more
than one)". Access File I/O commands open one file... you
could have several individual files open at the same time...
or you could copy the content into a table if you need all
the contents to be available concurrently.


Quote:
> Hi,

> I am trying to open the content of files ( more than one)
in VBA, which
> function or method I should look for in order to do so?  I
don't mind if it
> is using "drag and drop" or "Open Dialogue box" to select
multi-files.

> Thanks



Mon, 31 Jan 2005 06:00:13 GMT  
 Reading a batch files
Actually I am going to analyse all that content of the text file, so I need
to open a list of file and analyse the content of selected files.  Take an
example,
my project must be able to select 8000 files, then my project should be able
to open one by one and then analyse the content of the files ( all in text
format)

is it more clear now : )



Quote:
> There's code, contributed by Ken Getz, to use the Windows
> Common Dialog API directly, to obtain a file name in the API
> section of http://www.mvps.org/access. I don't exactly
> understand what you mean by "open the content of files (more
> than one)". Access File I/O commands open one file... you
> could have several individual files open at the same time...
> or you could copy the content into a table if you need all
> the contents to be available concurrently.



> > Hi,

> > I am trying to open the content of files ( more than one)
> in VBA, which
> > function or method I should look for in order to do so?  I
> don't mind if it
> > is using "drag and drop" or "Open Dialogue box" to select
> multi-files.

> > Thanks



Mon, 31 Jan 2005 10:46:19 GMT  
 Reading a batch files
If you know the name of the folder, you can use the Dir function to return
each file in that folder:

' Return all txt files in the root of C:\

strPath = "c:\*.txt" ' Set the path.
strFile = Dir(strPath) ' Retrieve the first entry.
Do While Len(strFile) <> "" ' Start the loop.
' Do whatever you have to with that file
   strFile = Dir ' Get next entry.
Loop

To allow the user to select the folder, see the second entry in the APIs
section of "The Access Web". http://www.mvps.org/access/

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele


Quote:
> Actually I am going to analyse all that content of the text file, so I
need
> to open a list of file and analyse the content of selected files.  Take an
> example,
> my project must be able to select 8000 files, then my project should be
able
> to open one by one and then analyse the content of the files ( all in text
> format)

> is it more clear now : )



> > There's code, contributed by Ken Getz, to use the Windows
> > Common Dialog API directly, to obtain a file name in the API
> > section of http://www.mvps.org/access. I don't exactly
> > understand what you mean by "open the content of files (more
> > than one)". Access File I/O commands open one file... you
> > could have several individual files open at the same time...
> > or you could copy the content into a table if you need all
> > the contents to be available concurrently.



> > > Hi,

> > > I am trying to open the content of files ( more than one)
> > in VBA, which
> > > function or method I should look for in order to do so?  I
> > don't mind if it
> > > is using "drag and drop" or "Open Dialogue box" to select
> > multi-files.

> > > Thanks



Tue, 01 Feb 2005 05:57:02 GMT  
 Reading a batch files
It works very well, thanks...
and do you know if it has OpenDialogue function in Excel VBA ??



Quote:
> If you know the name of the folder, you can use the Dir function to return
> each file in that folder:

> ' Return all txt files in the root of C:\

> strPath = "c:\*.txt" ' Set the path.
> strFile = Dir(strPath) ' Retrieve the first entry.
> Do While Len(strFile) <> "" ' Start the loop.
> ' Do whatever you have to with that file
>    strFile = Dir ' Get next entry.
> Loop

> To allow the user to select the folder, see the second entry in the APIs
> section of "The Access Web". http://www.mvps.org/access/

> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele



> > Actually I am going to analyse all that content of the text file, so I
> need
> > to open a list of file and analyse the content of selected files.  Take
an
> > example,
> > my project must be able to select 8000 files, then my project should be
> able
> > to open one by one and then analyse the content of the files ( all in
text
> > format)

> > is it more clear now : )



> > > There's code, contributed by Ken Getz, to use the Windows
> > > Common Dialog API directly, to obtain a file name in the API
> > > section of http://www.mvps.org/access. I don't exactly
> > > understand what you mean by "open the content of files (more
> > > than one)". Access File I/O commands open one file... you
> > > could have several individual files open at the same time...
> > > or you could copy the content into a table if you need all
> > > the contents to be available concurrently.



> > > > Hi,

> > > > I am trying to open the content of files ( more than one)
> > > in VBA, which
> > > > function or method I should look for in order to do so?  I
> > > don't mind if it
> > > > is using "drag and drop" or "Open Dialogue box" to select
> > > multi-files.

> > > > Thanks



Tue, 01 Feb 2005 09:39:48 GMT  
 Reading a batch files
Assuming you want the OpenDialogue function to get you a folder name, use
the code from "The Access Web" as I suggested before.
http://www.mvps.org/access/api/api0002.htm

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele


Quote:
> It works very well, thanks...
> and do you know if it has OpenDialogue function in Excel VBA ??



> > If you know the name of the folder, you can use the Dir function to
return
> > each file in that folder:

> > ' Return all txt files in the root of C:\

> > strPath = "c:\*.txt" ' Set the path.
> > strFile = Dir(strPath) ' Retrieve the first entry.
> > Do While Len(strFile) <> "" ' Start the loop.
> > ' Do whatever you have to with that file
> >    strFile = Dir ' Get next entry.
> > Loop

> > To allow the user to select the folder, see the second entry in the APIs
> > section of "The Access Web". http://www.mvps.org/access/

> > --
> > Doug Steele, Microsoft Access MVP
> > http://I.Am/DougSteele



> > > Actually I am going to analyse all that content of the text file, so I
> > need
> > > to open a list of file and analyse the content of selected files.
Take
> an
> > > example,
> > > my project must be able to select 8000 files, then my project should
be
> > able
> > > to open one by one and then analyse the content of the files ( all in
> text
> > > format)

> > > is it more clear now : )



> > > > There's code, contributed by Ken Getz, to use the Windows
> > > > Common Dialog API directly, to obtain a file name in the API
> > > > section of http://www.mvps.org/access. I don't exactly
> > > > understand what you mean by "open the content of files (more
> > > > than one)". Access File I/O commands open one file... you
> > > > could have several individual files open at the same time...
> > > > or you could copy the content into a table if you need all
> > > > the contents to be available concurrently.



> > > > > Hi,

> > > > > I am trying to open the content of files ( more than one)
> > > > in VBA, which
> > > > > function or method I should look for in order to do so?  I
> > > > don't mind if it
> > > > > is using "drag and drop" or "Open Dialogue box" to select
> > > > multi-files.

> > > > > Thanks



Wed, 02 Feb 2005 20:42:48 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. DOS Batch File to Copy Files from an Access Application

2. Batch reading a datareader.

3. Bad Command or File name when Shelling DOS Batch File

4. need batch file way to make Word97 convert a file

5. file compare inside a batch file

6. How do you pass parameters from a batch file to a VBS file

7. Running batch file from asp file

8. how to execute a batch file into a VBS file

9. Reading files from a zip file (Just reading the filenames, not unzipping or zipping)

10. VB3 Binary FILES READ READ READ

11. Logon Batch to call a VBS that calls another batch

12. Calling Batch file

 

 
Powered by phpBB® Forum Software