Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

problem figure 3 the last 2 pictures is the same Problem: Using the code of Figure 3 Code in other to convert the data .txt

problem image text in transcribed
figure 3
image text in transcribed
image text in transcribed
the last 2 pictures is the same
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. 1582 25 3549 6548 data - Notepad File Edit Format View Help First Name Last Name Gender Country Age Date Id Dulce Abril Female United States 32 15/10/2017 1562 2 Mara Hashimoto Female Great Britain 25 16/08/2016 Philip Gent Male France 36 21/05/2015 2587 Kathleen Hanner Female United States 15/10/2017 Nereida Magwood Female United States 58 16/08/2016 2468 6 Gaston Brumm Male United States 24 21/05/2015 2554 7 Etta Hurn Female Great Britain 56 15/10/2017 3598 8 Earlean Melgar Female United States 27 16/08/2016 2456 9 Vincenza Weiland Female United States 40 21/05/2015 10 Fallon Winward Female Great Britain 28 16/08/2016 5486 11 Arcelia Bouska Female Great Britain 39 21/05/2015 1258 12 Franklyn Unknow Male France 38 15/10/2017 2579 13 Sherron Ascencio Female Great Britain 32 16/08/2016 14 Marcel Zabriskie Male Great Britain 26 21/05/2015 15 Kina Hazelton Female Great Britain 31 16/08/2016 16 Shavonne Pia Female France 24 21/05/2015 1546 17 Shavon Benito Female France 39 15/10/2017 3579 18 Lauralee Perrine Female Great Britain 28 16/08/2016 19 Loreta Curren Female France 26 21/05/2015 9654 20 Teresa Strawn Female France 46 21/05/2015 3569 21 Belinda Partain Female United States 37 15/10/2017 2564 22 Holly Eudy Female United States 52 16/08/2016 8561 23 Many Cuccia Female Great Britain 46 21/05/2015 5489 24 Libbie Dalby Female France 42 21/05/2015 5489 3256 2587 3259 6597 Option Explicit Note that the indexing for the retumArray array is et up for 1-based indexing Sub ParseLine(dataLine As String, delimiter As String. _ Nvalues As Integer, returnArray0 As String) *This sub parses a line of data from the text file into individual pieces 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 currentText As String 'text since last comma Counter counts the number of pieces of data in the line. counter = 1 ReDim returnArray(counter) currentText is any piece of data in the line, where the pieces are separated by commas. CurrentText = Go through the string a character at a time. For i = 1 To Len(dataLine) Get the character in position i. char = Mid(dataLine, i. 1) Check if the character is a comma or the last character in the string If char = delimiter Then returnArray(counter) = currenttext are separated by commas. CurrentText = Go through the string a character at a time. For i = 1 To Len(dataLine) 'Get the character in position i. char = Mid(dataLine,i,1) har = maldatalin Check if the character is a comma or the last character in the string. If char = delimiter Then returnArray(counter) = currenttext 'Get ready for the next piece of data. currentText = counter = counter + 1 ReDim Preserve returnArray(counter) Elself i = Len(dataLine) Then Capture this last piece of data and return the number of pieces. currentText = currentText & 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 Next i 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. 1582 25 3549 6548 data - Notepad File Edit Format View Help First Name Last Name Gender Country Age Date Id Dulce Abril Female United States 32 15/10/2017 1562 2 Mara Hashimoto Female Great Britain 25 16/08/2016 Philip Gent Male France 36 21/05/2015 2587 Kathleen Hanner Female United States 15/10/2017 Nereida Magwood Female United States 58 16/08/2016 2468 6 Gaston Brumm Male United States 24 21/05/2015 2554 7 Etta Hurn Female Great Britain 56 15/10/2017 3598 8 Earlean Melgar Female United States 27 16/08/2016 2456 9 Vincenza Weiland Female United States 40 21/05/2015 10 Fallon Winward Female Great Britain 28 16/08/2016 5486 11 Arcelia Bouska Female Great Britain 39 21/05/2015 1258 12 Franklyn Unknow Male France 38 15/10/2017 2579 13 Sherron Ascencio Female Great Britain 32 16/08/2016 14 Marcel Zabriskie Male Great Britain 26 21/05/2015 15 Kina Hazelton Female Great Britain 31 16/08/2016 16 Shavonne Pia Female France 24 21/05/2015 1546 17 Shavon Benito Female France 39 15/10/2017 3579 18 Lauralee Perrine Female Great Britain 28 16/08/2016 19 Loreta Curren Female France 26 21/05/2015 9654 20 Teresa Strawn Female France 46 21/05/2015 3569 21 Belinda Partain Female United States 37 15/10/2017 2564 22 Holly Eudy Female United States 52 16/08/2016 8561 23 Many Cuccia Female Great Britain 46 21/05/2015 5489 24 Libbie Dalby Female France 42 21/05/2015 5489 3256 2587 3259 6597 Option Explicit Note that the indexing for the retumArray array is et up for 1-based indexing Sub ParseLine(dataLine As String, delimiter As String. _ Nvalues As Integer, returnArray0 As String) *This sub parses a line of data from the text file into individual pieces 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 currentText As String 'text since last comma Counter counts the number of pieces of data in the line. counter = 1 ReDim returnArray(counter) currentText is any piece of data in the line, where the pieces are separated by commas. CurrentText = Go through the string a character at a time. For i = 1 To Len(dataLine) Get the character in position i. char = Mid(dataLine, i. 1) Check if the character is a comma or the last character in the string If char = delimiter Then returnArray(counter) = currenttext are separated by commas. CurrentText = Go through the string a character at a time. For i = 1 To Len(dataLine) 'Get the character in position i. char = Mid(dataLine,i,1) har = maldatalin Check if the character is a comma or the last character in the string. If char = delimiter Then returnArray(counter) = currenttext 'Get ready for the next piece of data. currentText = counter = counter + 1 ReDim Preserve returnArray(counter) Elself i = Len(dataLine) Then Capture this last piece of data and return the number of pieces. currentText = currentText & 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 Next i End Sub

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting Tools for Business Decision Making

Authors: Paul D. Kimmel, Jerry J. Weygandt, Donald E. Kieso

5th edition

9780470418239, 470239808, 9780470239803, 470418230, 978-1118128169

More Books

Students also viewed these Accounting questions