This piece of code will be found at the finish of CSV files so you can iterate over rows in cvs files.
This is very useful with imacro otherwise you need to type in manually how many rows you got in to CSV files.
datasource – this is path to your datasource C://…
Hylas – this can be ignored 🙂
csv_file_name = your csv name which need to be put into Datasource directory.
// COUNT THE NUMBERS OF ROWS IN CSV FOR LOOP
const CRLF = “\r\n”;
const LF = “\n”;
var lines = new Array();
var file_i = imns.FIO.openNode(datasource+hylas+csv_file_name);
var text = imns.FIO.readTextFile(file_i); // Read file into one string
// Determine end-of-line marker
var eol = (text.indexOf(CRLF) == -1) ? LF : CRLF;
// Split into lines (number of lines) NUMBER OF LINES IN CSV
lines = text.split(eol);
eol = lines.length;
// FINISH COUNTING EOL = NUmber of LInes
SSD Hosting for 5 dollars a month https://www.digitalocean.com/?refcode=71a52388956e