Convert HTML table into ASP Array

At some point, I was parsing HTML text and needed to convert a table to an Array. The code basically strips any attributes, then cycles through all of the cells and returns an array. I used this code when converting reports from another system (that emitted HTML) to be used in data aggregation functions.

' * ==================================================================================================

Function ConvertTableToArray(sHTML,iTableNumber)

	Dim sTempHTML, aRows, aCols, i, iNumRows, iNumCols

	' Did we get a table?
	If inStr(1,sHTML,"
","") sTempHTML = Replace(sTempHTML,"","") sTempHTML = Replace(sTempHTML,"","") sTempHTML = Replace(sTempHTML,"","") ' ---- Split up the Rows: aRows = split(sTempHTML,"") ' ---- Split and Parse the Cols iNumRows = uBound(aRows) ' ---- Note that the first row is always empty iNumCols = uBound(split(aRows(1),"")) 'Response.Write iNumCols Dim aReturn, sTempString Redim aReturn(iNumRows,iNumCols) For i = 1 To iNumRows-1 aCols = Split(aRows(i),"") ' ---- Note that aCols(0) is always empty For i2 = 1 to iNumCols 'Response.Write aCols(i2) & "(" & i2 & ") - " sTempString = cStr(aCols(i2)) aReturn(i-1,i2-1) = sTempString Next 'Response.Write " " Next ConvertTableToArray = aReturn End Function
",1)>
keywords: 

AuthorInfo

Joe is a User Experience Engineer, Front End Specialist and Application Developer for Bridgeway Software, Inc and part-time consultant for NGO and non-profit organizations in the Houston area. Joe is also a part-time Portrait Photographer at MEDIA.24Moves.com and organizer of the HoustonPhotowalks.com photography club. He and his wife Marty run the AutismHouston.com Support and Playdate group.

-

@ext237

-

@drupaltips

-

Flickr

-

LinkedIn

-

Ports

-

Contact


Fatal error: Class CToolsCssCache contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (DrupalCacheInterface::__construct) in /home/content/e/x/t/ext237/html/modules/ctools/includes/css-cache.inc on line 52