Question : Split importing of a .CSV file using VB

I am using the VB command:
docmd.transfertext acimportdelim,"importSpecificationName","DNS_Scrub", filename,false
to import a .CSV file into a table in AC07.

However, my CSV file has a 'header' of 12 lines of text before it starts with the field names.  Is there a way to start importing at row 12?

Answer : Split importing of a .CSV file using VB

The method used below creates 2 new txt files to import, one for the header the second for the data.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
Sub subRemovetop12Rows()
    Dim fIn, fOut, strTemp,fHeaderOut
    fIn = "c:\data.txt"
    fOut = "c:\dataout.txt"
    fHeaderOut = "c:\dataHeaderOut.txt"
    Open fIn For Input As #1
    Open fOut For Output As #2
    Open fHeaderOut For Output As #3
    Do While Not EOF(1)
        i = i + 1
        Input #1, strTemp
        If i > 12 Then
            Print #2, strTemp
        Else
            'You might want to parse the header somehow here
            Print #3, strTemp
        End If
    Loop
    Close #1
    Close #2
    Close #3
End Sub
Random Solutions  
 
programming4us programming4us