Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem:Using the code of Figure 3 Code in other toconvert the data . txt file in to Excel data File in toTEXT data files. Click

Problem:Using the code of Figure 3 Code in other toconvert the data .txt file in to Excel data File in toTEXT data files. Click the image to downloaddata.dta-NctepadPhil:HelDulcehilip Gent Male rancsUnited es/2e1seretda Hapood Fenale nited StatescitainEtta Hurn enieVincenz. e lanArcella Bouska FemaleSherron AscencioKina HareltoninardOption ExplicitLastFemaleoceta cueren Feale FrareBelinda Partain Fenale tnited StatesHolly udy ealeLibble Dalby Female France 42End SubGendeFenale Uni ted StatesGreat Britain 39Fenale Great BritainFenale Great Britain 313116/08/201615/1e/2873579Dim i As IntegerDim char As StringCountry AgeteNote that the indexing for the returnArray array is et up' for 1-based indexing.Sub ParseLine(dataLine As String, delimiter As String,Current Text = umDate Id15/20/20?48/85/2815Nvalues As Integer, returnArray() As String)char = Mid(datalLine, i,1)ReDim returnArray(counter)21/e5/2815counter= counter +16/08/201621/85/21s/10/017256421/85/2e1: sA89Next i16/08/2816For i =1 To Len(dataLine)nValues = counterElse1252'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 counter As Integer counts the pieces of data in the lineDim currrentText As String ' text since last commaGo through the string a character ata time.Counter counts the number of pieces of data in the line.counter =1currenttext & Mid(dataLine, i,1)End IfcurrentText is any piece of data in the line, where the piecesseparated by commas.Get the character in position i.1582354965482596597Check if the character is a comma or the last character in the string.If char = delimiter ThenElself i = Len(dataLine) ThenreturnArray(counter)= currenttextGet ready for the next piece of data.CurrentText = m'Capture this last piece of data and return the number of pieces.currentText = currentText & Mid(dataLine, i,1)ReDim Preserve returnArray(counter)returnArray(counter)= currenttextare'Add this character to the currenttext string.currentText =Shavon Benito Fenale France
image text in transcribed

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

Spatial Database Systems Design Implementation And Project Management

Authors: Albert K.W. Yeung, G. Brent Hall

1st Edition

1402053932, 978-1402053931

More Books

Students also viewed these Databases questions

Question

1. Identify and control your anxieties

Answered: 1 week ago