Parsing a string

Results 1 to 2 of 2

Thread: Parsing a string

  1. #1
    Join Date
    Dec 1969

    Default Parsing a string

    This is probaly an easy one But I have text file that is fomatted like the following:<BR>Heading1: some data<BR>Heading2: some data2<BR>Heading3: some data3<BR><BR>I am reading the file putting it in an array and writing the results via a response.write. <BR><BR>I need to strip out all of the text up to the : on each line. My results should look like this:<BR><BR>somedata<BR>somedata2<BR>somedata3<BR ><BR>I know I am missing somethingeasy but any help is appreciated. <BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: Parsing a string

    For Each Line in strFile<BR>varStartData = InStr(Line, ": ")<BR>strData = Mid(Line, varStartData + 2, Len(Line))<BR><BR>Response.Write strData & "<BR>"<BR>Next<BR><BR>Or you can add it to an Array insted of Writting it to the page..<BR>Just Dim the Array with the right amount of Value&#039;s first.<BR><BR>Btw i have not tested this, so if it doesnt work dont hate me..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts