Help with Reading a Text File

Results 1 to 2 of 2

Thread: Help with Reading a Text File

  1. #1
    Join Date
    Dec 1969

    Default Help with Reading a Text File

    Hello all, <BR> I have a file with some text in this format(With spaces in between each word)<BR><BR>"TEXT ACCOUNT 1513 100.30 01-JUN-03 05019000900 IP" <BR> <BR>can someone help me how to grab from here the date(01-JUN-03) and the number next to it, any ideas will also be welcome. This is not a Fixed width text file, the date can appear anywhere but always in that format(DD-MON-YY). so far I have the code to open the file, and not sure what to do next.<BR><BR>folderPath = "C:Test"<BR>Set filesystem = Server.CreateObject("Scripting.FileSystemObject")< BR>Set filenamesystem = Server.CreateObject("Scripting.FileSystemObject")< BR><BR>Set prcfolder = filesystem.GetFolder(folderPath)<BR>Set filecollection = prcfolder.Files<BR><BR>For Each file in filecollection<BR> fileName<BR> Set namefile = filenamesystem.OpenTextFile(folderPath & "\" & fileName, 2, True) <BR> &#039; What Next?<BR> <BR>Next<BR><BR><BR>any help will be appreciated<BR>thanks<BR>das

  2. #2
    Join Date
    Dec 1969

    Default I can only get you..

    .. part of the way there.<BR><BR>But, you are going to need to use a regular expression that looks for a number, number, hyphen, letter, letter, letter, hyphen, number, number, space, string of characters, space.<BR><BR>There&#039;s a regular expression forum on this board that may be helpful.

Posting Permissions

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