Skip to main content Link Search Menu Expand Document (external link) Copy Copied

RemoveField

Removes a field, at the specified position, from the imported CSV data.


Syntax

expression.RemoveField(aIndex)

Parameters

The required aIndex argument is an identifier specifying a Long Type variable. Represents the index in which the field will be removed.

Returns value

Type: CSVinterface


See also
ImportFromCSV method, ImportFromCSVstring method.

Behavior

The RemoveField method will remove a field from all records, if they all have the same number of fields, from the current instance.

☕Example

Sub RemoveField()
    Dim CSVint As CSVinterface
    
    Set CSVint = New CSVinterface
    With CSVint.parseConfig
        .path = Environ("USERPROFILE") & "\Desktop\Chinese CSV.csv"
        .utf8EncodedFile = True                                         'The file is UTF-8 encoded
    End With
    With CSVint
        .ImportFromCSV .parseConfig
        .RemoveField 0                                                  'Remove the first field from all records"
    End With
    Set CSVint = Nothing
End Sub

Back to Methods overview