convert CSV to array using Javascript (not JQuery)

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
ledchoi
Posts: 8
Joined: Wed Mar 29, 2017 6:00 pm

convert CSV to array using Javascript (not JQuery)

Post by ledchoi » Mon Apr 17, 2017 1:38 am

Hello, I have a .csv file and I want to convert a .CSV file to an array using Javascript (not JQuery), reading from a .csv link in my computer.
Win7 (64 bit)
FF 52.0.2
iMacros v8.9.7

Thank you!
chivracq
Posts: 8716
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: convert CSV to array using Javascript (not JQuery)

Post by chivracq » Mon Apr 17, 2017 4:11 am

ledchoi wrote:Hello, I have a .csv file and I want to convert a .CSV file to an array using Javascript (not JQuery), reading from a .csv link in my computer.

Code: Select all

Win7 (64 bit)
FF 52.0.2
iMacros v8.9.7
Thank you!
Hum..., sorry but you have a completely "messy" way of Thinking, I'm afraid, ah-ah...! :shock:
Don't tell me I'm the first one to say "it", I won't believe you...! :wink:

But OK, first, FCI mentioned... => Perfect....! :D
I want to convert a .CSV file to an array using Javascript (not JQuery), reading from a .csv link
Then I read your Sentence 10 times and it still doesn't really make "sense" to me... :shock: :? :shock:
=> Convert a '.CSV' to an Array... Yeah tja, why not, that I understand, yep, will be an Array if you have only 1 Col, would/could become an Array of Arrays if you have more than 1 Col unless you deliberately want to keep it a 2D Array, but anyway it doesn't make much-much sense in combination with iMacros, you could better explain why and what you want to do, I'm afraid you have some very cumbersome Idea in your Mind for some cumbersome Implementation and this is going to become some never-ending Thread with Qt after Qt and Workaround on Workaround... :shock:
And from your "messy" way of thinking and explaining, I fear the worst, ah-ah...!! :twisted:

Why "JavaScript"...? Where comes the "not jQuery" from...?, using 'jQuery' with iMacros is already not very easy...

And what do you mean by "using JavaScript"...?
=> Using a '.js' Script...? A '.js' Script is a Script using a "Wrapper" on top of an '.iim' Script for the Interaction with the HTML Web-Page(s), the "pure" JavaScript part in the '.js' Script is for Conditional Logic, there is no Conditional Logic in "converting a '.CSV File' to an Array"...! :shock:

Hum, and I don't understand what "reading from a .csv link" means...

>

But, pfff, Answer to your Qt, or at least what I understand from it, and only about the "convert a '.CSV' to an Array" part..., done in '.iim', which can always easily be converted to a '.js' Script, is to retrieve all your Rows from your DataSource, but you may need some TEMP '.CSV' File to convert the Data to some "Horizontal" one-Cell Data (or the OS Clipboard) if you need to loop your original DataSource, and then using 'EVAL()' + 'concat()' to get a "full" String with all your Data to then convert it to an Array() using 'split()'...
But this is pretty cumbersome I would think... (and will be "slow" for Row_Nb > 20, compared to "other" Solutions, see below...)
Where does your '.CSV' come from...? Make if already ready for the 'split()' I would say...

But there are much better (and quicker) Solutions I would think... (that I have already posted several times on the Forum :idea: ), but give the "whole Picture" of what you want to do, with all Info about Site, what you want exactly, and provide some Sample of your '.CSV' File (and mention how many Rows)...

EDIT:
Missing word ("more") in "... if you have than 1 Col..." => "... if you have more than 1 Col..." (Corrected)
Last edited by chivracq on Sun Apr 23, 2017 5:41 am, edited 1 time in total.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
ravi_npatty
Posts: 22
Joined: Sat May 07, 2011 6:12 am

Re: convert CSV to array using Javascript (not JQuery)

Post by ravi_npatty » Sun Apr 23, 2017 4:16 am

This is very much possible.

All you need is to read the csv file line by line and parse it.

For file handling I use the following codes

Code: Select all


// deletes a file.
if(typeof(delete_file)!=typeof(Function))
{
	function delete_file(str_file)
	{
		var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
		file.initWithPath(str_file);
		
		if(file.exists())
		{
			file.remove(str_file);			
			return 0;
		}
		else
		{			
			return -1;
		}
		
	}
}

if(typeof(file_exists)!=typeof(Function))
{
	function file_exists(str_file)
	{
		var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
		file.initWithPath(str_file);
		
		if(file.exists())
		{
			return true;
		}
		return false;
	}
}

// reads file content and returns its content as array of string.
if(typeof(read_file)!=typeof(Function))
{
	function read_file(str_file)
	{
		var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
		file.initWithPath(str_file);
		
		if(file.exists())
		{
			//alert("input file exists and reading.");
		}
		else
		{
			//alert("input file not found. If you are running this for first time or you have manually deleted the csv file for recreation, this is normal. It will recreate the file from scratch.");
			return null;
		}
		// Note: "file" is an object that implements nsIFile. If you want the
		// file system path, use file.path
	
		// open an input stream from file
		var istream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
		istream.init(file, 0x01, 0444, 0);
		istream.QueryInterface(Components.interfaces.nsILineInputStream);
	 
		// read lines into array
		var line = {}, hasmore,i=0;
		var lines= new Array();
		do {
			  hasmore = istream.readLine(line);
			  lines[i]=""+line.value;
			  i++;		 
		} while(hasmore); 
		istream.close();	
		return (lines);
	}
}

//writes the data into the file str_file. This will overwrite if file already exists.
if(typeof(write_file)!=typeof(Function))
{
	function write_file(str_file,data)
	{
		var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
		file.initWithPath(str_file);	
		
		// file is nsIFile, data is a string
		var foStream = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
	 
		// use 0x02 | 0x10 to open file for appending.
		foStream.init(file, 0x02 | 0x08 | 0x20, 0666, 0);
		// write, create, truncate
		// In a c file operation, we have no need to set file mode with or operation,
		// directly using "r" or "w" usually.
	 
		// if you are sure there will never ever be any non-ascii text in data you can
		// also call foStream.write(data, data.length) directly
		var converter = Components.classes["@mozilla.org/intl/converter-output-stream;1"].createInstance(Components.interfaces.nsIConverterOutputStream);
		converter.init(foStream, "UTF-8", 0, 0);
		var datastr="";
		if(typeof(data)=="string") datastr=data;
		else
		for(i=0;i<data.length;i++)
		{	
			datastr+=data[i];
		}
		converter.writeString(datastr);
		converter.close(); // this closes foStream
	}
}

// append the data to file
if(typeof(append_file)!=typeof(Function))
{
	function append_file(str_file,data)
	{
		var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
		file.initWithPath(str_file);
		
		
		// file is nsIFile, data is a string
		var foStream = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
	 
		// use 0x02 | 0x10 to open file for appending.
		//use 0x02 | 0x08 | 0x20 to open file for overwriting
		foStream.init(file, 0x02 | 0x10 , 0666, 0);
		// write, create, truncate
		// In a c file operation, we have no need to set file mode with or operation,
		// directly using "r" or "w" usually.
	 
		// if you are sure there will never ever be any non-ascii text in data you can
		// also call foStream.write(data, data.length) directly
		var converter = Components.classes["@mozilla.org/intl/converter-output-stream;1"].createInstance(Components.interfaces.nsIConverterOutputStream);
		converter.init(foStream, "UTF-8", 0, 0);
		var datastr="";
		if(typeof(data)=="string") datastr=data;
		else
		{
			for(i=0;i<data.length;i++)
			{	
				datastr+=data[i];
			}
		}
		converter.writeString(datastr);
		converter.close(); // this closes foStream
	}
}

Above code will work upto imacros for firefox version 8.9.7. I stopped updating this add on since many features are not supprted from v9. So I am not sure if it will work in v9 and above.

I hope you know how to parse. I use substring and indexOf function for parsing.
Then I read your Sentence 10 times and it still doesn't really make "sense" to me... :shock: :? :shock:
=> Convert a '.CSV' to an Array... Yeah tja, why not, that I understand, yep, will be an Array if you have only 1 Col, would/could become an Array of Arrays if you have than 1 Col unless you deliberately want to keep it a 2D Array, but anyway it doesn't make much-much sense in combination with iMacros, you could better explain why and what you want to do, I'm afraid you have some very cumbersome Idea in your Mind for some cumbersome Implementation and this is going to become some never-ending Thread with Qt after Qt and Workaround on Workaround... :shock:
And from your "messy" way of thinking and explaining, I fear the worst, ah-ah...!! :twisted:
I feel we need not question the requirement. If we know the answer, we can contribute, otherwise we should let OP to find answer.We should not guide in wrong direction or discourage.
chivracq
Posts: 8716
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: convert CSV to array using Javascript (not JQuery)

Post by chivracq » Sun Apr 23, 2017 6:45 am

ravi_npatty wrote:This is very much possible.

All you need is to read the csv file line by line and parse it.

For file handling I use the following codes

Code: Select all


// deletes a file.
if(typeof(delete_file)!=typeof(Function))
{
	function delete_file(str_file)
	{
		var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
		file.initWithPath(str_file);
		
		if(file.exists())
		{
			file.remove(str_file);			
			return 0;
		}
		else
		{			
			return -1;
		}
		
	}
}

if(typeof(file_exists)!=typeof(Function))
{
	function file_exists(str_file)
	{
		var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
		file.initWithPath(str_file);
		
		if(file.exists())
		{
			return true;
		}
		return false;
	}
}

// reads file content and returns its content as array of string.
if(typeof(read_file)!=typeof(Function))
{
	function read_file(str_file)
	{
		var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
		file.initWithPath(str_file);
		
		if(file.exists())
		{
			//alert("input file exists and reading.");
		}
		else
		{
			//alert("input file not found. If you are running this for first time or you have manually deleted the csv file for recreation, this is normal. It will recreate the file from scratch.");
			return null;
		}
		// Note: "file" is an object that implements nsIFile. If you want the
		// file system path, use file.path
	
		// open an input stream from file
		var istream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
		istream.init(file, 0x01, 0444, 0);
		istream.QueryInterface(Components.interfaces.nsILineInputStream);
	 
		// read lines into array
		var line = {}, hasmore,i=0;
		var lines= new Array();
		do {
			  hasmore = istream.readLine(line);
			  lines[i]=""+line.value;
			  i++;		 
		} while(hasmore); 
		istream.close();	
		return (lines);
	}
}

//writes the data into the file str_file. This will overwrite if file already exists.
if(typeof(write_file)!=typeof(Function))
{
	function write_file(str_file,data)
	{
		var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
		file.initWithPath(str_file);	
		
		// file is nsIFile, data is a string
		var foStream = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
	 
		// use 0x02 | 0x10 to open file for appending.
		foStream.init(file, 0x02 | 0x08 | 0x20, 0666, 0);
		// write, create, truncate
		// In a c file operation, we have no need to set file mode with or operation,
		// directly using "r" or "w" usually.
	 
		// if you are sure there will never ever be any non-ascii text in data you can
		// also call foStream.write(data, data.length) directly
		var converter = Components.classes["@mozilla.org/intl/converter-output-stream;1"].createInstance(Components.interfaces.nsIConverterOutputStream);
		converter.init(foStream, "UTF-8", 0, 0);
		var datastr="";
		if(typeof(data)=="string") datastr=data;
		else
		for(i=0;i<data.length;i++)
		{	
			datastr+=data[i];
		}
		converter.writeString(datastr);
		converter.close(); // this closes foStream
	}
}

// append the data to file
if(typeof(append_file)!=typeof(Function))
{
	function append_file(str_file,data)
	{
		var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
		file.initWithPath(str_file);
		
		
		// file is nsIFile, data is a string
		var foStream = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
	 
		// use 0x02 | 0x10 to open file for appending.
		//use 0x02 | 0x08 | 0x20 to open file for overwriting
		foStream.init(file, 0x02 | 0x10 , 0666, 0);
		// write, create, truncate
		// In a c file operation, we have no need to set file mode with or operation,
		// directly using "r" or "w" usually.
	 
		// if you are sure there will never ever be any non-ascii text in data you can
		// also call foStream.write(data, data.length) directly
		var converter = Components.classes["@mozilla.org/intl/converter-output-stream;1"].createInstance(Components.interfaces.nsIConverterOutputStream);
		converter.init(foStream, "UTF-8", 0, 0);
		var datastr="";
		if(typeof(data)=="string") datastr=data;
		else
		{
			for(i=0;i<data.length;i++)
			{	
				datastr+=data[i];
			}
		}
		converter.writeString(datastr);
		converter.close(); // this closes foStream
	}
}

Above code will work upto imacros for firefox version 8.9.7. I stopped updating this add on since many features are not supprted from v9. So I am not sure if it will work in v9 and above.

I hope you know how to parse. I use substring and indexOf function for parsing.
Ouf-ouf-ouf, waf-waf...!, deadly impressive, this is a very "High-Level" Solution, by kind of re-coding your own iMacros from scratch, but I would be surprised if @OP understands how to use it, I can vaguely "follow" it and understand it, but OK, I'm no JavaScript Guru, that's why I do all my Coding with iMacros in pure '.iim'... (We could use your Help on the Forum from time to time btw, ah-ah...!, lack of Expertise for JS Questions...)

This Solution will still be "slow" I'm afraid, handling 100 Rows in the '.CSV' would take at least 5 sec, I would think, => 1000 Rows = 1 min... One whole minute during which FF and iMacros will appear to be frozen and not doing anything...
And it uses a lot of native FF/JS Commands, very likely to get broken by future Versions of the Browser, I would think...
(=> Not mentioned, but "current" FF Version (April 2017) is FF52, + iMacros for FF v8.9.7 indeed.)

'>>>
ravi_npatty wrote:
Then I read your Sentence 10 times and it still doesn't really make "sense" to me... :shock: :? :shock:
=> Convert a '.CSV' to an Array... Yeah tja, why not, that I understand, yep, will be an Array if you have only 1 Col, would/could become an Array of Arrays if you have than 1 Col unless you deliberately want to keep it a 2D Array, but anyway it doesn't make much-much sense in combination with iMacros, you could better explain why and what you want to do, I'm afraid you have some very cumbersome Idea in your Mind for some cumbersome Implementation and this is going to become some never-ending Thread with Qt after Qt and Workaround on Workaround... :shock:
And from your "messy" way of thinking and explaining, I fear the worst, ah-ah...!! :twisted:
I feel we need not question the requirement. If we know the answer, we can contribute, otherwise we should let OP to find answer.We should not guide in wrong direction or discourage.
Hum..., I don't really agree, based on my "Experience" on the Forum: In maybe 9 out of 10 "such" Threads/Qt's with some short and precise Qt, the Answer/Implementation calls another Qt and another Qt which usually gives a chain of Workarounds on Workarounds for a very cumbersome Final Solution/Script while knowing from the beginning the "full" Picture of what the User exactly wants to do allows to provide a short(er) and simple(r) Solution/Script that the User will understand much more easily, and other Users as well to reuse/adapt for their own Needs...

It's a bit like solving a Rubik's Cube, ah-ah...! 8) 30 years ago, I used to know a Set of maybe 50 "Formulas", which allowed me to have a 90% Solving Time under 30 sec, now 30 years later and no practice anymore except touching one from time to time when visiting some Friends and grabbing some dust collecting Cube between books and statues, I can still solve it with only a Set of 7 or maybe 10 max Formulas that my hands strangely automatically remember and which still work for all Combinations and make me "happy" if I manage (with a bit of luck) to solve it in less than 1 min...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
ravi_npatty
Posts: 22
Joined: Sat May 07, 2011 6:12 am

Re: convert CSV to array using Javascript (not JQuery)

Post by ravi_npatty » Sun May 06, 2018 5:45 pm

Sorry I did not follow this thread for long. So delayed reply.
Ouf-ouf-ouf, waf-waf...!, deadly impressive, this is a very "High-Level" Solution, by kind of re-coding your own iMacros from scratch, but I would be surprised if @OP understands how to use it, I can vaguely "follow" it and understand it, but OK, I'm no JavaScript Guru, that's why I do all my Coding with iMacros in pure '.iim'... (We could use your Help on the Forum from time to time btw, ah-ah...!, lack of Expertise for JS Questions...)
Few years back I was having exactly same question. I did not believe it was possible with this add on. While surfing this forum I came across one solution where direct file handling was used. From there my imcaros usage pattern has totally changed. I found that most of the MDN library likehttps://developer.mozilla.org/en-US/doc ... s/File_I_O codes work in imacros .js. (sometimes with minor tweak). Had that initial post was not there about direct file handling, I would not have learnt these and imacros would not have been much useful for me. So I feel, we should not discourage OP.

OP had asked something very brilliant. We will help if we can. Otherwise let OP on his own.
This Solution will still be "slow" I'm afraid, handling 100 Rows in the '.CSV' would take at least 5 sec, I would think, => 1000 Rows = 1 min... One whole minute during which FF and iMacros will appear to be frozen and not doing anything...
Here you got it totally wrong. reading or writting csv data in iMacros way will be terribly slow. In javascript way, I am loading data having about 50 columns and about 10000 rows in fraction of second. For this speed advantage only I prefer imacros for firefox javascript interface. I will be glad to freeze my firefox for few milli seconds than seeing iim to load all the csv lines one by one for hours.

And it uses a lot of native FF/JS Commands, very likely to get broken by future Versions of the Browser, I would think...
(=> Not mentioned, but "current" FF Version (April 2017) is FF52, + iMacros for FF v8.9.7 indeed.)
You are right regarding this will get broken in future version, but iMacros itself got broken now. So no surprise.

Sorry if I hurt your feelings. I just wanted to put the possibilities here.

I am not happy to see iMacros is becoming inactive. I saw somewhere that beta version will be out soon. Hope the powers we had in 8.9.7 returns.
chivracq
Posts: 8716
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: convert CSV to array using Javascript (not JQuery)

Post by chivracq » Sun May 06, 2018 6:56 pm

ravi_npatty wrote:Sorry I did not follow this thread for long. So delayed reply.
Yeah, don't worry, was an interesting Thread anyway, nice to bump it again, ah-ah...! 8)
ravi_npatty wrote:
Ouf-ouf-ouf, waf-waf...!, deadly impressive, this is a very "High-Level" Solution, by kind of re-coding your own iMacros from scratch, but I would be surprised if @OP understands how to use it, I can vaguely "follow" it and understand it, but OK, I'm no JavaScript Guru, that's why I do all my Coding with iMacros in pure '.iim'... (We could use your Help on the Forum from time to time btw, ah-ah...!, lack of Expertise for JS Questions...)
Few years back I was having exactly same question. I did not believe it was possible with this add on. While surfing this forum I came across one solution where direct file handling was used. From there my imcaros usage pattern has totally changed. I found that most of the MDN library likehttps://developer.mozilla.org/en-US/doc ... s/File_I_O codes work in imacros .js. (sometimes with minor tweak). Had that initial post was not there about direct file handling, I would not have learnt these and imacros would not have been much useful for me. So I feel, we should not discourage OP.

OP had asked something very brilliant. We will help if we can. Otherwise let OP on his own.
Hum..., so "brilliant" that I still don't really understand the Qt because of its vague Formulation, ah-ah...!, and the Purpose for such Functionality...
But @OP never followed up, so I guess we'll never know, ah-ah...! :roll:

Even if I recently implemented for myself some similar/related Functionality (in pure '.iim', I don't use any '.js), where one Macro_1 scans through a whole Web-Page with about 2000 Items, saves several "Properties" for Max 18 Items in 3 different Categories (3x6) using a "specific" Format with all 18 Items in just one Col/Cell..., to later reuse that Temp '.CSV' from a second Macro_2 which re-splits the Content of each '!COL1' into a separate Array for each Row where some Input from the 2nd Page will compute which Index to use on the Array (of variable Length) to decide dynamically which Item(s) to select (and in which Order)...
ravi_npatty wrote:
This Solution will still be "slow" I'm afraid, handling 100 Rows in the '.CSV' would take at least 5 sec, I would think, => 1000 Rows = 1 min... One whole minute during which FF and iMacros will appear to be frozen and not doing anything...
Here you got it totally wrong. reading or writting csv data in iMacros way will be terribly slow. In javascript way, I am loading data having about 50 columns and about 10000 rows in fraction of second. For this speed advantage only I prefer imacros for firefox javascript interface. I will be glad to freeze my firefox for few milli seconds than seeing iim to load all the csv lines one by one for hours.
Ah OK, good to hear about the Speed with your Sol, but, like I said, you don't need iMacros anymore as you've kind of recoded your own Add-on yourself and you don't use any iMacros Commands in your Script...

In some related Thread, some other User had posted a Solution as a '.js' Script looping through the '.CSV' with some on-the-fly computed '.iim' Macro that would handle 1000 Rows in about 2min, I think, while I posted here in the same Thread a Solution in pure '.iim' that would handle those 1000 Rows in about 0.35-0.45sec. (I only tested then with 1000 Rows, but handling 10,000 Rows would still take less than 1sec I think...)
(Oh...!, and my Sol only takes 3 Lines, ah-ah...! 8) )
ravi_npatty wrote:
And it uses a lot of native FF/JS Commands, very likely to get broken by future Versions of the Browser, I would think...
(=> Not mentioned, but "current" FF Version (April 2017) is FF52, + iMacros for FF v8.9.7 indeed.)
You are right regarding this will get broken in future version, but iMacros itself got broken now. So no surprise.

Sorry if I hurt your feelings. I just wanted to put the possibilities here.

I am not happy to see iMacros is becoming inactive. I saw somewhere that beta version will be out soon. Hope the powers we had in 8.9.7 returns.
Don't worry, you didn't "hurt my feelings", ah-ah...! I'm actually more "hurt" by @OP who didn't follow up at all in this/their Thread, grrrr...!!

Yeah, don't be fooled by the "soon", some v10.x for FF should have already been released before Novb 2017 last year, before FF57 got rolled out, and now 6 months later, May 2018, we are still waiting, oops...! :oops:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
ravi_npatty
Posts: 22
Joined: Sat May 07, 2011 6:12 am

Re: convert CSV to array using Javascript (not JQuery)

Post by ravi_npatty » Mon May 07, 2018 8:39 am

you don't need iMacros anymore as you've kind of recoded your own Add-on yourself and you don't use any iMacros Commands in your Script...
I use imacros command only for page loading, waiting and handling download. But I need this JavaScript interact for doing all other stuff like file handing, Dom handling (interacting with web pages) are fine with JavaScript way (or MDN way). . Even though I am managing my work with selenium for now, selenium takes about five times the development time compared to imacros for Firefox.


I pray God to return the interface which I enjoyed for years.
chivracq
Posts: 8716
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: convert CSV to array using Javascript (not JQuery)

Post by chivracq » Mon May 07, 2018 10:56 am

ravi_npatty wrote:
you don't need iMacros anymore as you've kind of recoded your own Add-on yourself and you don't use any iMacros Commands in your Script...
I use imacros command only for page loading, waiting and handling download. But I need this JavaScript interact for doing all other stuff like file handing, Dom handling (interacting with web pages) are fine with JavaScript way (or MDN way). . Even though I am managing my work with selenium for now, selenium takes about five times the development time compared to imacros for Firefox.

I pray God to return the interface which I enjoyed for years.
Yeah-yeah, I saw your interesting Post in the 'iMacros for FF Compatibility with FF56+' Thread, and hum, concerning 'Selenium', I think the iMacros Enterprise Edition has now since v11.5 or v12.0 an Export Functionality to 'Selenium', though I guess it probably won't be of much use for you as it probably is rather meant for converting '.iim' Scripts using the "Standard" iMacros Commands...
You could maybe have a look at 'Katalon' which has a Plugin/Add-on for FF and CR and works (and records) a bit like iMacros and has as well some Export to 'Selenium' Functionality... That might speed up a bit your Development Process... :idea:

Hum, I'm not sure the "Pray" Communication will be very efficient in this "Case", you can better send a Mail to your "God", even if I don't think we have any "God" yet who registered on the Forum, so I guess they probably won't really care about iMacros, ah-ah...!
(... => Meaning that Religious/Political/Sexual "Content" can preferably be left out of the Forum, this is a Technical Forum... :wink: )

But hum, like @thecoder2012 mentioned in a Reply to your Post, you could consider using Pale Moon or WaterFox, I use PM as well myself for my "Prod" Env., and I actually still use iMacros for FF v8.8.2...!! (on PM v24.3.3 + Win10_x64), but v8.8.7 for FF and v8.9.7 for FF were/are very stable and work perfectly on PM and WF.
But that might not be an Option for Users in some Enterprise Env. where some IT Dept might be forcing them to use (a) specific Browser(s) and to update it/them regularly...
Oh...!, and you were on Linux, there is no PM Version for Linux I think, not sure about WF, but you could try to find some "other" FF-forked Browser supporting Linux as OS...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
ravi_npatty
Posts: 22
Joined: Sat May 07, 2011 6:12 am

Re: convert CSV to array using Javascript (not JQuery)

Post by ravi_npatty » Mon May 07, 2018 11:37 am

Thanks for your suggestions. I am finding ways and means with selenium except it is taking some time. Otherwise I am fine with selenium.

I use cyberfox and imacros for FF 8.9.7 for running scripts which are not yet ported to selenium. I have locked cyberfox version so I am safe for time being.

Thanks.
chivracq
Posts: 8716
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: convert CSV to array using Javascript (not JQuery)

Post by chivracq » Mon May 07, 2018 1:00 pm

ravi_npatty wrote:Thanks for your suggestions. I am finding ways and means with selenium except it is taking some time. Otherwise I am fine with selenium.

I use cyberfox and imacros for FF 8.9.7 for running scripts which are not yet ported to selenium. I have locked cyberfox version so I am safe for time being.

Thanks.
Ah OK, good to hear that Cyberfox works on Linux indeed... 8)
You could mention which Version of CF you are using together with iMacros for FF v8.9.7, as the CB Site looks directly a bit "messy and buggy" to me, with No Archive of previous Versions, Dead Links, many Typos, inconsistent Layout, unnecessary 1 Pixel horizontal Scrolling, Copyright till 2016 on some Pages, not clear to me why separate "Intel" + "AMD" Versions while the same Hardware Requirements are listed for both... (and I only looked around for a few minutes...)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
User avatar
thecoder2012
Posts: 358
Joined: Sat Aug 15, 2015 5:14 pm
Location: Internet
Contact:

Re: convert CSV to array using Javascript (not JQuery)

Post by thecoder2012 » Mon May 07, 2018 9:41 pm

chivracq wrote:...not clear to me why separate "Intel" + "AMD" Versions while the same Hardware Requirements are listed for both...
Optimized editions = little faster. 8)
chivracq wrote:But hum, like @thecoder2012 mentioned in a Reply to your Post, you could consider using Pale Moon or WaterFox,...
Cyberfox 52 is a security risk in the near future. See Cyberfox and its future direction
FF52 (ESR): https://wiki.mozilla.org/Release_Management/Calendar
I see no other choice than Pale Moon or WaterFox in the future :(
chivracq wrote:Oh...!, and you were on Linux, there is no PM Version for Linux I think, not sure about WF, but you could try to find some "other" FF-forked Browser supporting Linux as OS...
Pale Moon is possible under Linux. See http://linux.palemoon.org/
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me! :idea:
Post Reply