...

View Full Version : Reading from file help please! very urgent!



RaviUK
07-14-2005, 11:45 AM
Hello! I'm very new to using Javascript, and need everyones help please.

What I am trying to do is creat a HTML file that will use Javascript to read data in from a file....this I can do.
However what I want to do is have a text file like the following:

data.txt
"1","2","3","4","5"
"3","4","2","4","5"
"2","3","4","2","3"


and read each of these values in seperatly into sperate arrays (as though this file was a simple database file, and each line would represnt a new row in the database).

My question is....is this possible within javascript? if so, can someone give me the example code to do so with the above data please (pls include as much info as you can, as though your doing an "idiots guide" as i am an idiot and a newbie!! lol)

Many thanks in advance

martin_narg
08-08-2005, 01:20 PM
You can use FSO for IE and read in by line (the ReadLine method)

Example included in the link:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/jsmthopenastextstream.asp

Hope this helps

m_n



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum