Unfortunately, you can't create an import spec to do that. I generally use low-level IO to import the text file. I have several examples on my website (see sig below) that illustrate this. "ImportLineInput.mdb" is one such.
Another thing you could do is run code to remove the header and footer and then import it through the wizard. Something like this:
CODE
Sub CleanFile(DirtyFile As String, CleanFile As String)
Dim MyString As String
Dim i As Integer
Open DirtyFile For Input As #1
Open CleanFile For Output As #2
Do While Not EOF(1)
Line Input #1, MyString
'Output the line Record
If InStr(MyString, "|") > 0 Then
Print #2, MyString
End If
Loop
' Close text file.
MsgBox "Done!"
Close #1
Close #2
End Sub
And call it like this:
CODE
Function RunCleanFiles()
Call CleanFile("C:\DirtyLineInput.txt", "C:\LineInput.txt")
End Function
This will read each line and only output the lines that have your delimiter ("|") in it.
Edited by: Roger_Carlson on Mon Mar 19 12:58:33 EDT 2007.
Edited by: Roger_Carlson on Mon Mar 19 12:59:21 EDT 2007.