phantomjs javascript read a local file line by line
问题 I've never used javascript to read a file line by line, and phantomjs is a whole new ballgame for me. i know that there is a read() function in phantom, but I'm not entirely sure how to manipulate the data after storing it to a variable. My pseudocode is something like: filedata = read('test.txt'); newdata = split(filedata, "\n"); foreach(newdata as nd) { //do stuff here with the line } If anyone could please help me with real code syntax, I'm a bit confused as to whether or not phantomjs