December 2, 2016 at 10:11 am #21409
Stefan
Participant
the string after equal sign(=). I have to modify them one by one to make them be consecutive.
FROM:
partnr=[1!#10]
productgroup=[1!#2]
productsubgroup=[1!#3]
description1=”zh_CN@”+[1!#15]+”;”+”en_US@”+[1!#16]+”;”
note=”zh_CN@”+[1!#17]+”;”+”en_US@”+[1!#18]+”;”
assemblyposition count=[1!#4]
parentvariant=[1!#5]
partnr=[1!#6]
pos=[1!#7]
TO:
partnr=[1!#1]
productgroup=[1!#2]
productsubgroup=[1!#3]
partnr=[1!#4]
productgroup=[1!#5]
productsubgroup=[1!#6]
description1=”zh_CN@”+[1!#15]+”;”+”en_US@”+[1!#16]+”;”
note=”zh_CN@”+[1!#17]+”;”+”en_US@”+[1!#18]+”;”
assemblyposition count=[1!#7]
parentvariant=[1!#8]
partnr=[1!#9]
pos=[1!#10]
Use for example:
if( document.selection.IsEmpty ) {document.selection.SelectAll();}
sSel = document.selection.text; //alert(sSel);
aLines = sSel.split("\r\n");
aOut="";
iCount=1;
for (var i=0,x=aLines.length;i<x;i++) {
if (aLines[i].match(/=\[1!#\d+\]/)){
aOut += aLines[i].replace(/=\[1!#\d+\]/,'=[1!#'+iCount+']') + "\r\n";
iCount++;
}
else {
aOut += aLines[i] + "\r\n";
}
};
alert(aOut);
//document.selection.text = aOut;
HTH? ;-)