On 14-Jun-11 11:40, Prinn, Craig wrote:
I am looking for a way to translate and ebcidic file to ascii. Is there a pre-existing library for this, or do I need to do this from scratch? If from scratch and ideas on where to start?
Bear in mind that there's no 100% straight-across translation, because ASCII and EBCDIC each has characters that the other lacks. However, to translate the character codes they share in common, you could do something as simple as using the translation table functionality built in to the string class in Python, setting up a table to convert between one and the other.
of course, if you are on a Unix-like system, there's already a command for that, to convert a file "E" from EBCDIC to a file "A" in ASCII:
$ dd if=E of=A conv=ascii or the other way: $ dd if=A of=E conv=ebcdic -- Steve Willoughby / st...@alchemy.com "A ship in harbor is safe, but that is not what ships are built for." PGP Fingerprint 4615 3CCE 0F29 AE6C 8FF4 CA01 73FE 997A 765D 696C _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor