analyzing a text file

Results 1 to 2 of 2

Thread: analyzing a text file

  1. #1
    Join Date
    Dec 1969

    Default analyzing a text file

    hi all, maybe someone could point me in the right direction on this one -- i've got an online poll that writes its results to a text file. then, i have an asp page that reads that text file. i want to analyze each response in the text file and respond back with the findings. a loops reads each line as a variable; and, then reads the next line as the same variable and so forth, so the variable keeps getting redefined. i'm trying to assign each variable/line as (i) of an array prior to it getting redefined, that way I can analyze it all after I've gone through ever line. trouble is, i keep getting type mismatch errors with my array. help?

  2. #2
    Join Date
    Dec 1969

    Default RE: analyzing a text file

    &#039;Object declaritions up here, create your textfile and so forth<BR>&#039;Declare an array and a tempstring variable and a counter<BR><BR>i = 0<BR>Do While objtxtFile.AtEndOfStream &#060;&#062; True<BR> strTxtLine = objtxtFile.ReadLine &#039;here is your redefined variable part.<BR> <BR> Redim Preserve aryItems(i)<BR> aryItems(i) = strTxtLine &#039;here you are putting the line into an array<BR> i = i + 1<BR>Loop<BR><BR>THIS will be SLOW. Redim Preserve is a performance nightmare. If I were you I would (greatly depending on the file information) try to do something like building a large string with a "~" char as a delimeter. Then Split(string,"~") later in the code to get an array out of it. If the information is large then I would evaluvate the code again to find a different solution.<BR><BR>Redim preserve = nightmare

Posting Permissions

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