help using FSO

Results 1 to 4 of 4

Thread: help using FSO

  1. #1
    mrpr Guest

    Default help using FSO

    Hi All,<BR><BR>I am trying out something like this:<BR><BR>My application should read the data from the text file which consits of weather details from various regions of world.<BR><BR>Eg: <BR>1200,North America,12,22,8,22,..,..,..,..<BR>1200,North America,12,22,8,22,..,..,..,..<BR>1200,North America,12,22,8,22,..,..,..,..<BR>1200,North America,12,22,8,22,..,..,..,..<BR><BR>The txt file on the whole consists of 11 fields if thought in terms of databse seperated by coma.<BR><BR>My problem is i need to read from the txt file and show the output in a neat html format with titles<BR><BR>Eg:<BR><BR>Time Place Max Min Field5 Field6 Field7 .... .... Field11<BR><BR>and underneath each of the titles I should display the timezone, place name, max temp, min temp etc.<BR><BR>I am able to read the data from the file but not able to show it properly.<BR><BR>I have found the solution for this using database (sql server). My asp coding reads the data from the text file and inserts the data into the database, which i am retrieving and showing, so far it is ok.<BR><BR>But, i want to do it just using FSO. The database is becoming a turn around kind of thing.<BR><BR>Help on this will be appreciated a lot.<BR><BR>I hope I am clear on what I wanted to convey.<BR><BR>Thanking in advance.<BR>bye for now,<BR>mrpr

  2. #2
    Join Date
    Dec 1969

    Default RE: help using FSO

    The FSO write textstream in the format:<BR>data1 ,data2 ,data3 ,data5...<BR>so when you read the textstream out, just use the VBS function &#039Split(string," ,")&#039 like:<BR><BR>varArray=Split(string," ,") <BR><BR>then put every element in any place you want<BR><BR>&#060;%For i=0 to UBound(varArray)%&#062;<BR>&#060;td&#062;&#060;%=v arArray(i)%&#062;&#060;/td&#062;<BR>&#060;%next%&#062;<BR>

  3. #3
    Eddie Campbell Guest

    Default RE: help using FSO

    You could try reading in the file line by line at then using split to turn the values into an array which you can use to populate your table. Something like this ( This only reads 1 line, but you get the idea:<BR><BR>Response.write "&#060;Table&#062;"<BR>Dim Fso, MyFile, MyString, MyArray<BR>Set Fso = CreateObject("Scripting.FileSYstemObject")<BR>Set MyFile = Fso.OpenTextFile("C:TempMyTextFile.Txt",1)<BR>MySt ring = MyFile.ReadLine<BR>MyArray = Split(MyString,",",-1,1)<BR>For i = 0 to 10<BR>Response.Write "&#060;TD&#062;" & MyArray(i) & "&#060;/td&#062;"<BR>Next<BR>Response.Write "&#060;/Table&#062;"

  4. #4
    mrpr Guest

    Default RE: help using FSO

    hey, thanks both of you. i just did not try, i&#039ll try and let you know.<BR><BR>bye<BR>thanks for the prompt response

Posting Permissions

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