Hi!
How to replace a string in my document with a list of values in an array?
For example for Hello:
var array = ["Heil","BYE","CIAO","Salut",...]
I want this result:
I'm trying to do this with this code, but I don't know how to read a line:
Thanks for help guys.
How to replace a string in my document with a list of values in an array?
For example for Hello:
Code: Select all
dasfasfasfHello Worlddfhhd
fghfjuj Hello USAfgdgfg
asdasd Hello ITALY agfg
asdfHello Francehjm
asdHello Chinahdg
I want this result:
Code: Select all
dasfasfasf Heil Worlddfhhd
fghfjuj BYE USAfgdgfg
asdasd CIAO ITALY agfg
asdf Salut Francehjm
.
.
.
Code: Select all
function myReplace() {
var array= [“Heil”,”BYE”,”CIAO”,”Salut”];
UltraEdit.activeDocument.top();
for (var nVariable = 0; nVariable < 10; nVariable++){ // How to insert length of document?
var s=UltraEdit.activeDocument.selectLine();
var t=array[nVariable];
s.findReplace.replace("1", t); // how i can do here?
}
UltraEdit.outputWindow.write("as");
}
myReplace();