SCHEMA.INI set line 32 of text file

User avatar
sal21
PlatinumLounger
Posts: 4362
Joined: 26 Apr 2010, 17:36

SCHEMA.INI set line 32 of text file

Post by sal21 »

I have the txt file similar:
dsfds
dsfdsf
dsfdsf
dsfdsfds
dsdsfdsf
ds
...
erewe;ewrewr;ewrewrewr;ewrewr;ewrewrewR;

The first line that contain ; is the line number 32

How to set the schema.ini to read the txt file from the line 32, is possible?

Code: Select all

Private Sub DBImportText_TEST()

    Dim intFile As Integer
    Dim StarsTextFile As String, strTextFolder As String

    On Error GoTo ExitHandler

    StarsTextFile = "TABULATI.TXT"
    strTextFolder = "C:\TEMP\"

    Close #intFile
    intFile = FreeFile(0)
    Open strTextFolder & "schema.ini" For Output As #intFile
    Print #intFile, "[" & StarsTextFile & "]"
    Print #intFile, "ColNameHeader = TRUE"
    Print #intFile, "CharacterSet = ANSI"
    Print #intFile, "Format = Delimited(;)"
    Close #intFile

    Call DUE_TEST_1

    Kill strTextFolder & "schema.ini"

    Exit Sub

ExitHandler:

    MsgBox Err.Description, vbExclamation

End Sub


User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: SCHEMA.INI set line 32 of text file

Post by HansV »

There is no setting in Schema.ini to specify that the data start at row 32. You can only use

ColNameHeader=True

to specify that the first row contains column headings or

ColNameHeader=False

to specify that the first row contains data.
Best wishes,
Hans