PDA

View Full Version : How to read a CSV file?


RichardE
10-16-2002, 09:41 PM
How can I read the contents of a CSV file into an array?

Thanks in advance!

beetle
10-16-2002, 09:46 PM
Can't, not with javascript. You could manually cut and paste a CSV into a variable and work with it from there....but javascript cannot read files that are on the server.

ActiveX lets you read client-side files, but I doubt that's what you are after...

whammy
10-17-2002, 12:42 AM
You can do it with VBScript, but this will only work locally on a Windows platform, in IE browsers(not sure which versions) on the 'net (which creates the ActiveX object Beetle is referring to), or used with ASP(server-side)...

You would do this with "Scripting.FileSystemObject":

http://www.w3schools.com/asp/asp_ref_filesystem.asp

P.S. The site above is one of the best sites on the net IMHO - I've learned a lot there. ;)