Record count and file creation date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a method in which I can get the following information from an
exported delimited text file:-

1. How many records were created?
2. When was the file created (date stamped)?
 
Ken said:
Is there a method in which I can get the following information from an
exported delimited text file:-

1. How many records were created?
2. When was the file created (date stamped)?

1. The only way to retrieve this info is by counting the rows. There is more
than one way to do this, but my preferred method would be to run this code:

Dim dummy As String
Dim RowCount As Long

Open FileName For Input As 1
Do While Not EOF(1)
Line Input #1, dummy
If dummy <> "" Then
RowCount = RowCount + 1
End If
Loop
Close 1

RowCount now holds the number of rows (records) exported.

2. Use the FileDateTime function:

Dim dt As Date

dt = FileDateTime(FileName)
 
Thanks... This is indeed useful.

Stuart McCall said:
1. The only way to retrieve this info is by counting the rows. There is more
than one way to do this, but my preferred method would be to run this code:

Dim dummy As String
Dim RowCount As Long

Open FileName For Input As 1
Do While Not EOF(1)
Line Input #1, dummy
If dummy <> "" Then
RowCount = RowCount + 1
End If
Loop
Close 1

RowCount now holds the number of rows (records) exported.

2. Use the FileDateTime function:

Dim dt As Date

dt = FileDateTime(FileName)
 
Back
Top