i was wondering how could i convert EBCDIC value to clear text using UltraEdit.
E.g. If EBCDIC value E7E2C3E3 is converted to clear text, it'd be XSCT.
appreciate your valuable expertise.
Welcome to the IDM Forum. This forum is meant as a user-to-user support mechanism where users can share knowledge and tips for all IDM software.
Since these forums are user-to-user based, IDM does not regularly read or reply to the posts in this forum. For problem reports, suggestions, or feature requests, you must email us directly. Our trained technical support staff answers most inquiries within 30 minutes.

E7E2C3E3
E7 E2 C3 E3
XSCT
XSCT
// First select the entire contents of the active document:
UltraEdit.activeDocument.selectAll();
// Next retrieve the selected data into a variable:
var iLines = UltraEdit.activeDocument.selection;
// Delete contents of active file:
UltraEdit.activeDocument.deleteText();
// Remove spaces
iLines = iLines.replace(/[ ]/g,"");
// Split into lines - assume DOS format line endings
var iLineArr = iLines.split("\r\n");
// outputvariable:
var oStr = "";
// Run through all lines
for (i=0;i<iLineArr.length;i++) {
// Drop empty lines
if(iLineArr[i].length < 2) {
continue;
}
// Run through single line
for (j=0;j<iLineArr[i].length;j=j+2) {
var iChr = iLineArr[i].substr(j,2); /* read a single hex escaped character */
if(iChr=="00") { /* hex 00 is suppressed as blank */
iChr="40"; /* hex 40 = blank in EBCDIC */
}
// Un-escape two character hex into single character EBCDIC
oStr = oStr + String.fromCharCode(parseInt( iChr, 16 ));
}
// 0D=>CR 25=>LF i EBCDIC
oStr = oStr + String.fromCharCode(parseInt( "0D", 16 ));
oStr = oStr + String.fromCharCode(parseInt( "25", 16 ));
// Write un-escaped line back into the active UE document
UltraEdit.activeDocument.write(oStr);
oStr = "";
}
// Convert from EBCDIC to ASCII:
UltraEdit.activeDocument.fromEBCDIC();


