Enhanced Split Function for VB.NET
Author: Alastair Vance
Version Compatibility: Visual Basic.NET
Place code on a form. Place a listvew control on the form. Set up view style as "details".
You will need to write a sub to call previewfile using the following parameters:
ByRef lv As ListView (listview name), ByVal FileName As String (delimited file name), ByVal Delimiter As String (delimiter character), ByVal Qualifier As String (qualifier character), ByVal IgnoreLines As Integer (number of lines to ignore at beginning)An Example:
Dim MySplitLine As Collection MyString = "1,""My Text"",5061,""Some more, text."",839" MySplitLine = SplitDelimitedLine(MyString, ",", """")This example would return 5 sections.
Some more, text.
Instructions: Copy the declarations and code below and paste directly into your VB project.