ASCII 2 EBCDIC Command Line

ASCII 2 EBCDIC Command Line

2
NewbieNewbie
2

    Aug 14, 2006#1

    Is there a simple command line string that will convert file A in ASCII to File B in EBCDIC?

    6,687587
    Grand MasterGrand Master
    6,687587

      Aug 14, 2006#2

      No. The page Command Line Parameters in the help of UltraEdit describes all command line parameters. You could write a macro which converts every open file to EBCDIC and saves it with same name or copies the content of the ASCII file, pastes it into a new file, converts it to EBCDIC and saves the new file with a name based on the name of the ASCII file. This macro saved into a macro file can then be executed with 1 or more ASCII files via command line.
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Aug 14, 2006#3

        Bummer - Thanx....

        1
        NewbieNewbie
        1

          Aug 03, 2011#4

          As I am a User and not a real programmer, could anyone post the script or macro which will do this. And pls also the instruction on how to implement this?
          Thank you

          6,687587
          Grand MasterGrand Master
          6,687587

            Aug 03, 2011#5

            Copy following few lines into a new file and save this file for example as ASCIItoEBCDIC.js into a directory of your choice.

            Code: Select all

            for (var nDocIndex = 0; nDocIndex < UltraEdit.document.length; nDocIndex++) {
               var sNewFileName = UltraEdit.document[nDocIndex].path.replace(/\./,"_EBCDIC.");
               UltraEdit.document[nDocIndex].toEBCDIC();
               UltraEdit.document[nDocIndex].setActive();
               UltraEdit.saveAs(sNewFileName);
            }
            This script can be added to the list of scripts by opening Scripting - Scripts and pressing button Add.

            The script converts all files currently open in UltraEdit from ASCII to EBCDIC and saves all files in the same directory as original file with same name, but with _EBCDIC inserted before the point separating file name with path from file extension. The script will fail if the file path contains a point. The script will overwrite the original file if the file name has no point. For example file

            C:\Temp\Test.txt

            is converted from ASCII to EBCDIC and saved as

            C:\Temp\Test_EBCDIC.txt

            You can now start UltraEdit, open all files you want to convert and run the script from menu Scripting or the Script List view.

            If you want to run the script from within a batch file to convert for example all files with extension TXT you can use following command line in the batch file

            "full path to UltraEdit program directory\uedit32.exe" /fni *.txt /s,e="full path to script file\ASCIItoEBCDIC.js"