(→Translate a Text File from EBCDIC to ASCII) |
(→Translate a Text File from EBCDIC to ASCII) |
||
| Line 11: | Line 11: | ||
#Select <kbd>Block</kbd> > <kbd>Select all</kbd> or <kbd>Ctrl-A</kbd> to mark the entire file as a block. | #Select <kbd>Block</kbd> > <kbd>Select all</kbd> or <kbd>Ctrl-A</kbd> to mark the entire file as a block. | ||
#Select <kbd>Edit</kbd> > <kbd>Translate</kbd> > <kbd>Translate from EBCDIC</kbd> to translate the file to ASCII. | #Select <kbd>Edit</kbd> > <kbd>Translate</kbd> > <kbd>Translate from EBCDIC</kbd> to translate the file to ASCII. | ||
| + | |||
If the original EBCDIC file consisted of fixed-length records without end-of-record characters, you may want to add an ASCII “newline” (Carriage-Return and Line-Feed) to the end of each record so that Windows/DOS programs can more easily read it. | If the original EBCDIC file consisted of fixed-length records without end-of-record characters, you may want to add an ASCII “newline” (Carriage-Return and Line-Feed) to the end of each record so that Windows/DOS programs can more easily read it. | ||
| + | |||
#Select <kbd>CONFIG</kbd> > <kbd>File handling</kbd> > <kbd>File type</kbd> and set the correct record length. Records should now be nicely aligned on the screen. | #Select <kbd>CONFIG</kbd> > <kbd>File handling</kbd> > <kbd>File type</kbd> and set the correct record length. Records should now be nicely aligned on the screen. | ||
| Line 18: | Line 20: | ||
#*The macro will automatically change the ''File type'' to “0” or “1” to recognize the selected ASCII newline and make the file more readable on the screen. Therefore, you won’t see any change on the screen even though the file was converted. | #*The macro will automatically change the ''File type'' to “0” or “1” to recognize the selected ASCII newline and make the file more readable on the screen. Therefore, you won’t see any change on the screen even though the file was converted. | ||
#Select <kbd>File</kbd> > <kbd>Close buffer</kbd> or <kbd>File</kbd> > <kbd>Exit</kbd> to save the translated file. | #Select <kbd>File</kbd> > <kbd>Close buffer</kbd> or <kbd>File</kbd> > <kbd>Exit</kbd> to save the translated file. | ||
| + | |||
<div class="callout important">Since IBM PC ASCII and EBCDIC have somewhat different character sets, not all characters will translate correctly. In particular, there is no equivalent of most IBM PC graphics characters. Therefore, if you translate a file to EBCDIC and then back again to ASCII, you may not have the same file again. Some punctuation, e.g. “[”, “]”, “|”, and many control | <div class="callout important">Since IBM PC ASCII and EBCDIC have somewhat different character sets, not all characters will translate correctly. In particular, there is no equivalent of most IBM PC graphics characters. Therefore, if you translate a file to EBCDIC and then back again to ASCII, you may not have the same file again. Some punctuation, e.g. “[”, “]”, “|”, and many control | ||
Translate an EBCDIC text file downloaded from an IBM mainframe into ASCII for use on a PC using vEdit.
The EBCDIC translate table ebcdic.tbl is built into vEdit and does not need to be loaded. However, for custom needs you can modify the ebcdic.tbl file and then load the revised EBCDIC table into vEdit.
If the original EBCDIC file consisted of fixed-length records without end-of-record characters, you may want to add an ASCII “newline” (Carriage-Return and Line-Feed) to the end of each record so that Windows/DOS programs can more easily read it.
Instead of translating an EBCDIC file, you can also display the file in ASCII by pressing Alt-D eight times to toggle to the “EBCDIC” display mode, as indicated on the status line. In this EBCDIC mode, the same translation table is used, but only for display purposes; the EBCDIC file itself is not changed.
Similarly, an ASCII file can be translated to EBCDIC with Edit > Translate > Translate to EBCDIC