Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Reading from file help please! very urgent!

    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

  • #2
    Regular Coder martin_narg's Avatar
    Join Date
    Jul 2002
    Location
    Chamonix, France
    Posts
    600
    Thanks
    1
    Thanked 3 Times in 3 Posts
    You can use FSO for IE and read in by line (the ReadLine method)

    Example included in the link:
    http://msdn.microsoft.com/library/de...textstream.asp

    Hope this helps

    m_n
    "Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
    and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
    -Tommy Cooper


  •  

    Posting Permissions

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