point86 Posted December 6, 2006 Share Posted December 6, 2006 Hi,Im fairly new to javascript etc so please be patient! :DIm have a text file which I need to split into strings, and then enter these strings into an arrray.Thus, I have something like this:1 hello2 how are you3 goodbyeI want to split this into strings (with each line being a new string) and turn this into the following:a[0] = 'hello'a[1] = 'how are you'a[2] = 'goodbye'Once in the array, the numbers in the original text become unimportant. Now I know that this can be achieved with an arraylist and possibly a scanner(?). But I dont know the syntax to implement these constructs.Any help would be much appreciated! :DThanksPoint86. Quote Link to comment Share on other sites More sharing options...
mithu_sree Posted December 11, 2006 Share Posted December 11, 2006 How will u open ur file?Do u think Javascript supports file handling? Quote Link to comment Share on other sites More sharing options...
fenway Posted December 16, 2006 Share Posted December 16, 2006 And, more so, I don't know what you're trying to accomplish. Quote Link to comment Share on other sites More sharing options...
artacus Posted December 17, 2006 Share Posted December 17, 2006 I concur, what you're doing doesn't make sense. Nonetheless, you can use PHP to read the file and generate a JS array in your document. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.