Convert EBCDIC(.DAT) FILE into ASCII FILE

Hi Team,

I am having 100 EBCDIC files (i.e. DAT extension) and need to convert them into ASCII File by unix shell script.
I tried with DD Command but its not providing output as expected.

Sample Text:
------------------

��������@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Expected Output:
-------------------

ABCDEFGHI||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Kindly suggest me how to achieve this through unix shell script.

Regards,
JSM

Welcome JSM,

I have a few to questions pose in response first:-

  • Is this homework/assignment? There are specific forums for these.
  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
  • What are your preferred tools? (C, shell, perl, awk, etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)

Most importantly, What have you tried so far? You mention using dd, but what flags did you use and what output did you get that was wrong? Having a .dat files does not necessarily mean that the data is EBCIDIC.

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future. I've added CODE tags to you post to make the data clearer.

We're all here to learn and getting the relevant information will help us all.

Kind regards,
Robin

We also need to know more about the data files. When people say "EBCDIC" they often mean "packed decimal" which is a completely different problem.

Long story short, if you can't post a representative sample of the data - preferably fed through hexdump -C < file.dat first - we can't help you.