469,579 Members | 1,090 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,579 developers. It's quick & easy.

Find File Attributes

Roy
Hello,
As a part of my application,I need to compare files generated
everyday.I need not need to compare the file contents.I just need to
compare the file size,the line count.The files are named in the
format,Hyyyymmdd,H denoting History.
At present,I use the Dir function to search for the physical existence
of the file and I use the debug.print for functions such as
filelen(path),GetAttr() etc.
My question is how would I put this as a module so that I can use a
date function to compare files generated today with that of yesterday
(mondays files to be compared against fridays).
Also is it possible to output this as a text file?

Thanks,

Roy

Aug 5 '07 #1
1 1664

"Roy" <pr********@yahoo.comwrote in message
news:11**********************@o61g2000hsh.googlegr oups.com...
Hello,
As a part of my application,I need to compare files generated
everyday.I need not need to compare the file contents.I just need to
compare the file size,the line count.The files are named in the
format,Hyyyymmdd,H denoting History.
At present,I use the Dir function to search for the physical existence
of the file and I use the debug.print for functions such as
filelen(path),GetAttr() etc.
My question is how would I put this as
a module so that I can use a date function
to compare files generated today with that
of yesterday (mondays files to be compared
against fridays).
Let me see: if, as you say earlier, you are using those now, and displaying
the results with Debug.Print, you must have them in a module already. And,
it would appear that you are using Dir to do the search, you already have
the structure set up... decide which day is going to be the "master" and,
when you find the file, try to open the corresponding file for the other day
(that should not interfere with your subsequent use of Dir to find other
files for the "master" day, if there are any).
Also is it possible to output this as a text file?
Surely. Check Help for Open, Print and Print #, and Close. If your
comparison is going to keep history, I suspect you will want to open the
Comparison File for Append. You also will need to decide whether you want
to keep the data in fixed field format (each field starting in a specified
character position) or in delimited form, with each field separated from the
next by your chosen delimiter.

Maybe even easier, keep the information in a Table, and simply Export as
Text, or use the VBA TransferText to export it as a Text File.

Larry Linson
Microsoft Access MVP
Aug 5 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Mark | last post: by
18 posts views Thread by strchild | last post: by
16 posts views Thread by TT (Tom Tempelaere) | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.