This documentation is archived and is not being maintained.

Troubleshooting Exceptions: Microsoft.VisualBasic.FileIO.TextFieldParser.MalformedLineException

A MalformedLineException exception is thrown when a TextFieldParser cannot parse a row using the specified format.

The Error Line property of the exception object contains the text of the line causing the error.

Check to ensure the TextFieldType and Delimiter parameters are defined properly

The TextFieldType (delimited or fixed-width) must match the format of the file. If the TextFieldType is FixedWidth, check that the FieldWidths property has been set correctly. If the TextFieldType is Delimited, check that the Delimiters property has been set correctly.