I had the task of a simple FTP file transfer from a Mainframe to the development box. Easy enough, until I discovered the horrors of EBCDIC. Anyways, the UNIX tool dd converts one file type to another. To convert from EBCDIC to ASCII, set the conv=ascii parameter.
The problem with this is that the file I have are fixed length records. When specifying the record length, dd goes and trims the trailing spaces off each record. To fix this:
dd conv=ascii if=[in file] | fold -w[record length] > [out file]









0 Responses to “Keep trailing spaces when unblocking with dd”