* I know I can go and change this by just opening the .csv with Notepad++ and replace it all but I have a lot of other situations where I really need to know how to replace this
* I know how to use the replace on EVAL but when the <> or the / are on the equation (in this case </BR>) then the EVAL doesn't work properly with me
* I tried to escape the value 2, 3 or even 4 times but no luck
* I need the solution to go using the EVAL, no other work around such as using a website where I can replace the content (that is my actual approach but I think I can do this with EVAL so I don't need to use this site)
My Config:
Win10 x64
Firefox Palemoon x86 24.6.2
iMacros 8.8.2
Weight = 180pounds
Height = 169cm
Age = 31
Here is my code:
Code: Select all
var macros;
macros = "CODE:";
// PARAMETERS
macros += "SET !ERRORIGNORE YES" + "\n";
// DATABASE GENERAL
macros += "SET !DATASOURCE C:\\General.csv" + "\n";
macros += "SET !DATASOURCE_LINE 1" + "\n";
macros += "SET COMENTARIO_INICIO_DESCRIPCION_MESES {{!COL11}}" + "\n";
macros += "SET DESCRIPCION_MESES {{!COL16}}" + "\n";
macros += "SET COMENTARIO_FINAL_DESCRIPCION_MESES {{!COL20}}" + "\n";
// CHANGING </BR> for <BR>
macros += "SET DESCRIPTION {{COMENTARIO_INICIO_DESCRIPCION_MESES}}</BR></BR>{{DESCRIPCION_MESES}}</BR></BR>{{COMENTARIO_FINAL_DESCRIPCION_MESES}}" + "\n";
// --- TESTS ---
// macros += "SET DESCRIPTION EVAL(\"var extr2='{{DESCRIPTION}}'; extr2.replace(/['/BR']/g,'BR');\")" + "\n";
// macros += "SET DESCRIPTION EVAL(\"var extr2='{{DESCRIPTION}}'; extr2.replace(//BR/g,'BR');\")" + "\n";
// macros += "SET DESCRIPTION EVAL(\"var extr2='{{DESCRIPTION}}'; extr2.replace(/</BR>/g,'<BR'>);\")" + "\n";
// macros += "SET DESCRIPTION EVAL(\"var extr2='{{DESCRIPTION}}'; extr2.replace(/[<'/BR>']/g,<'BR>');\")" + "\n";
// macros += "SET DESCRIPCION_-PERIODO- EVAL(\"var extr2='{{DESCRIPCION_-PERIODO-}}'; extr2.replace(/[/]/g,'');\")" + "\n"; // This seems to work as it delete the / but it also affects others parts of the text where there is a / so is not good.
// etc....
// --- TESTS ---
macros += "PROMPT {{DESCRIPCION_MESES}}" + "\n";
iimPlay(macros)