I want to make an script for Google Spreadsheet, in order to replace automatically a series of strings (actually, for translating strings from one language to the other). The thing is that I have to do this everyday, and a Script would allow me to save a lot of time.
I found this script made by Bannager Bong. and it works for one single string, but I would want to make it work for an array of elements:
function fandr() {
var r=SpreadsheetApp.getActiveSheet().getDataRange();
var rws=r.getNumRows();
var cls=r.getNumColumns();
var i,j,a,find,repl;
find="abc";
repl="xyz";
for (i=1;i<=rws;i++) {
for (j=1;j<=cls;j++) {
a=r.getCell(i, j).getValue();
if (r.getCell(i,j).getFormula()) {continue;}
try {
a=a.replace(find,repl);
r.getCell(i, j).setValue(a);
}
catch (err) {continue;}
}
}
}
so for instance I would like to loop the variables from find=["abc","aaa","ooo"]; and changing those strings to repl=["xyz","UUU","aAa"];
However given my poor skills in programming, I don't know how to procede.
Could you please help me?
Thanks in advance,