- Home /
Parse an online text file
Hi,
Could someone please explain how I can read a text file online that contains urls and store each of these links into seperate variables?
Thanks for your time :)
How are they stored in the file? Like one per line, or some other separator?
Answer by DaveA · Mar 11, 2011 at 09:16 AM
Look at the docs for WWW (to get the file), and google MSDN string Split to parse the file. Split will create an array of values, there you go.
Sorry if I sound like a bit of an idiot:) But I found this link: http://msdn.microsoft.com/en-us/library/system.string.split.aspx is that what you meant? As I though I was using JS ? Thanks
Yeah that's it. Pretty much the same for both languages. Note to split a string on, say, a semicolon would be myString.Split(";"[0])
Thanks I tried that with this code: http://pastie.org/1663597 saying Sorry, DirectoryNotFoundException: Could not find a part of the path "/Users/apple741/Desktop/ParseTest/http:/dl.dropbox.com/u/8176796/colours.txt".