Question: ption Explicit Note that the indexing for the returnArray array is et up for 1-based indexing. sub ParseLine(dataline As String, delimiter As String, - Nvalues

ption Explicit Note that the indexing for the returnArray array is et up for 1-based indexing. sub ParseLine(dataline As String, delimiter As String, - Nvalues As integer, retumArray0 As String) "This sub parses a line of data from the text file into individual pleces of data. 'It returns an array of the pieces of data and number of pieces (in nValues). Dim i As integer Dim char As String Dim counter As integer' counts the pieces of data in the line Dim currrentText As String' text since last comma Counter counts the number of pieces of dala in the line. counter =1 ReDim returnAray(counter) currentText is any plece of data in the line, where the pieces ' are separated by commas. CurrentText = " Go through the string a character at a time. Fori =1 To Len(dataLine) Get the character in positioni. char = Mid(dataLine, i, 1) Check it the character is a comma or the last charader in the sting. If char = delimiter Then retumArray(counter) = currenttext ' Get ready for the next plece of data. curentText = - counter = counter +1 ReDim Preserve retumAuray(counter) Elself i= Len(dataLine) Then - Capture this last piece of data and retum the number of pieces. currentText = currentT ext \& Mid (dataLine, i, 1) returnArray ( counter )= currenttext nValues = counter Else - Add this character to the currenttext string. currentText = currenttext \& Mid(dataLine, i, 1) End If Nexti End Sub Problem: Using the code of Figure 3 Code in other to convert the data txt file in to Excel data File in to TEXT data files. Click the image to download data
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
