Mostly Linux & Python syntax notes and hyperlinks.

Wednesday, November 25, 2009

Linux: EBCDIC to ASCII conversion

To convert from EBCDIC to ASCII:
$ iconv -f EBCDIC-US -t ASCII  EBCDICinput > ASCIIoutput
You can also use dd:
$ dd if=EBCDICinput of=ASCIIoutput conv=ascii

$ file -i EBCDICinput 
EBCDICinput : text/plain; charset=iso-8859-1
$ file ASCIIoutput
ASCIIoutput: ASCII text, with very long lines, with no line terminators
Though I've found the first one (iconv) will keep pipe characters as "|", and the second (dd) will have them as "!" in the ASCII output file.

1 comment: