Edit text file USing CasperJs -


is possible read text file , replace character or strings , save in new file using casperjs? tried searching lot can find reading , writing data in text files...


my main aim fetch text , store in json file, problem getting \n text.

i can fetch text , store in json file, remove \n character, thought of opening file , replace "\n" null.

text fetched:

hello abc 

i using these commands:

var = this.fetchtext({type: 'xpath', path: 'tr5'}); this.echo(json.stringify(a));    

output:

hello\n abc 

and don't want \n character. want print "hello" , "abc" in same line.

expected:

hello abc 

please me code.

so phantomjs has fs module capable of reading , writing. answer question yes casper uses fs module read , write. if need casper open file , read line line can that. casper javascript. if want parse file line line remove characters, add characters etc... of can done using casperjs.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -