Turning Text into a variable

Results 1 to 2 of 2

Thread: Turning Text into a variable

  1. #1
    Nathan Masek Guest

    Default Turning Text into a variable

    If I had a text file (just a .txt) and I wantdd to search it using the regexp method, do I need to convert to a string before I can search it? If so, how do I convert a text file to a string.<BR>I am guessing I would use the textstream object somehow but I am not quite sure how (or if I even need to convert it).<BR><BR>Any help would be aprecitaed.<BR><BR>- Thanks<BR>- Nathan Masek

  2. #2
    Join Date
    Dec 1969

    Default RE: Turning *FILE* contents into VBS string...

    Yes, regexp can *only* work on strings.<BR><BR>You could do something like this:<BR><BR>&#060;%<BR>Set FSO = Server.CreateObject("Scripting.FileSystemObject")< BR>Set inFile = FSO.OpenTextFile( "yourFileName.txt" )<BR>textString = inFile.ReadAll<BR>inFile.Close<BR>%&#062;<BR><BR>a nd now you can use that textString in your search code.<BR><BR>

Posting Permissions

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