472,127 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

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 1761

"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
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.