I would import the text file contents into a temprary Access database table as a first step. Perhaps create an Import Template within Access. Then use Code to Import Text..
Or, open the text file via Open Command...
Here is some psuedo code from using Open Command... htwh,
...
Open APP_PATH & "dir_list_mdb.lst" For Input As #1 'open the directory list file and load table
Do While Not EOF(1)
lcAction_Text = "Ready to Compact."
llcompactflag = True
Input #1, sFilePath
'strip the base path to save the overall number of characters
If InStr(1, sFilePath, lcBase_Path) <> 0 Then
sFilePath = Mid(sFilePath, Len(lcBase_Path) + 1)
End If
If InStr(1, sFilePath, "'"

<> 0 Then
sCorrectedFilePath = Replace_String(sFilePath, "'", ""

Else
sCorrectedFilePath = sFilePath
End If
'Check Exception List
If llcompactflag = True Then
If Chk_Exception(lcBase_Path, sCorrectedFilePath) = True Then
'File in Exception List
lcAction_Text = "File Excluded from Compact. File is listed in exception_list table."
llcompactflag = False
End If
End If
'Check Last Compact Date
If llcompactflag = True Then
If Chk_Compact(lcBase_Path, sCorrectedFilePath, lnComp_Gen) = True Then
'File in Exception List
lcAction_Text = "File Excluded from Compact. File was recently compacted per Action_Log table."
llcompactflag = False
End If
End If
'Check Modify Date
Set oFSO = CreateObject("Scripting.FileSystemObject"

Set oFileOrig = oFSO.GetFile(lcBase_Path & sFilePath)
dOrigFileSize = oFileOrig.Size
dtOrigFileDate = oFileOrig.DateLastModified
If llcompactflag = True Then
If DateDiff("d", oFileOrig.DateLastModified, Now()) > lnMod_Gen Then
'Ok Compact File
Else
lcAction_Text = "File Excluded from Compact. File was recently modified."
llcompactflag = False
End If
End If
'Check File Attributes
dOrigFileAttributes = oFileOrig.Attributes
If llcompactflag = True Then
If dOrigFileAttributes And 1 Then
'Read-Only Set
lcAction_Text = "File Excluded from Compact. File is Read-Only."
llcompactflag = False
End If
End If
'Check ldb (lock) file - Not sure if this should be here or just before Compact Action?
If llcompactflag = True Then
If oFSO.FileExists(lcBase_Path & Left(sFilePath, Len(sFilePath) - 3) & "ldb"

Then
'Check Date-Stamp/Attributes.
Set oFileLdb = oFSO.GetFile(lcBase_Path & Left(sFilePath, Len((sFilePath)) - 3) & "ldb"

If DateDiff("d", oFileLdb.DateLastModified, Now()) > lnMod_Gen Then
'Delete ldb File and Continue with Compact!
oFileLdbAttributes = oFileLdb.Attributes 'check if ldb file is read-only.
If oFileLdbAttributes And 1 Then
'Read-Only Set
lcAction_Text = "File Excluded from Compact. Lock (ldb) File Appears Old and is Read-Only Can Not Delete."
llcompactflag = False
Else
'May Need to Add Error Handler Here if Kill Fails!
Kill lcBase_Path & oFileLdb.Name 'Delete the ldb file on basepath location.
DelayTime 10 'Slight delay to insure file action completed.
End If
Else
lcAction_Text = "File Excluded from Compact. File appears to be locked since a recent ldb file exists."
llcompactflag = False
End If
Else
'Ok to Compact. No .ldb file found.
End If
End If
'Check if File can be openned - Perhaps link to a System Table on a database?
'SELECT Count(MSysObjects.Id) AS CountOfId FROM MSysObjects;
'Load data into Dir_List Table
lnCountOfDIRList = lnCountOfDIRList + 1
With RsDList
.AddNew
.Fields("rec_counter"

= lnCountOfDIRList
.Fields("basepath"

= lcBase_Path
.Fields("filepath"

= sFilePath
.Fields("action"

= lcAction_Text
.Fields("actiondate"

= Now()
.Fields("compactflag"

= llcompactflag
.Fields("fixedfilepath"

= sCorrectedFilePath
.Fields("filesize"

= dOrigFileSize
.Fields("lastmodifieddate"

= dtOrigFileDate
.Fields("fileattributes"

= dOrigFileAttributes
.Update
End With
Loop 'end doloop not EOF(1)
Close #1
Steve Medvid
"IT Consultant & Web Master"
e-Mail: Stephen_Medvid@GMACM.com
Chester County, PA Residents
Please Show Your Support...