EBCDIC Format to Normal String


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting EBCDIC Format to Normal String
# 1  
Old 02-27-2012
EBCDIC Format to Normal String

Hi,
I have EBCDIC format file and i wold like to convert normal string(user readable) in unix .
The source having the binary IBM file format
Sample Source Format:

Code:
נפנסנס@@@@@@@@@@@@@@נסֲננפנסנס@@@@@@@@@@@@@@נס׳ננפנסנס@@@@@@@@@@@@@@נקֲננפנסנס@@@@@@@@@@@@@@נק׳ננפנסנס@@@@@@@@@@@@@@נשֲננפנסנס@@@@@@@@@@@@@@נש׳ננפנסנס@@@@@@@@@@@@@@סנֲננפנסנס@@@@@@@@@@@@@@סנ׳ננפנסנע@@@@@@@@@@@@@@נסֲננפנסנע@@@@@@@@@@@@@@נס׳ננפנסנע@@@@@@@@@@@@@@נשֲננפנסנע@@@@@@@@@@@@@@נש׳ננפנסנע@@@@@@@@@@@@@@סנֲננפנסנע@@@@@@@@@@@@@@סנ׳ננפנסנף@@@@@@@@@@@@@@נסֲננפנסנף@@@@@@@@@@@@@@נס׳ננפנסנף@@@@@@@@@@@@@@נשֲננפנסנף@@@@@@@@@@@@@@נש׳ננפנסנף@@@@@@@@@@@@@@סנֲננפנסנף@@@@@@@@@@@@@@סנ׳ננפנסנפ@@@@@@@@@@@@@@נסֲננפנסנפ@@@@@@@@@@@@@@נס׳סנפנסנפ@@@@@@@@@@@@@@נפֲסנפנסנפ@@@@@@@@@@@@@@נפ׳סנפנסנפ@@@@@@@@@@@@@@נקֲננפנסנפ@@@@@@@@@@@@@@נק׳סנפנסנפ@@@@@@@@@@@@@@נשֲננפנסנפ@@@@@@@@@@@@@@נש׳סנפנסנפ@@@@@@@@@@@@@@סנֲננפנסנפ@@@@@@@@@@@@@@סנ׳סנפנסנץ@@@@@@@@@@@@@@נסֲננפנסנץ@@@@@@@@@@@@@@נס׳ננפנסנץ@@@@@@@@@@@@@@נשֲננפנסנץ@@@@@@@@@@@@@@נש׳ננפנסנץ@@@@@@@@@@@@@@סנֲננפנסנץ@@@@@@@@@@@@@@סנ׳ננפסעעס@@@@@@@@@@@@@@נס׳ננפסעעף@@@@@@@@@@@@@@נףֲננפסעעף@@@@@@@@@@@@@@נף׳ננפסעעף@@@@@@@@@@@@@@נסֲננפסעעף@@@@@@@@@@@@@@נס׳ננפסעעע@@@@@@@@@@@@@@נץ׳


I have write a code like the follwoing.
Code:

dd if=<SRCPATH>yyy.xxx.RB065 of=<SRCPATH>/output.csv ibs=800 cbs=80 conv=ascii,lcase;

Then the output file contains:
HTML Code:
040101              01B0040101              01P0040101              07B0040101  
            07P0040101              09B0040101              09P0040101          
    10B0040101              10P0040102              01B0040102              01P0
040102              09B0040102              09P0040102              10B0040102  
            10P0040103              01B0040103              01P0040103          
    09B0040103              09P0040103              10B0040103              10P0
But it not in user readable format
How to convert the EBDIC format to nomal sting in unix.
# 2  
Old 02-27-2012
There are few tools available to convert ebcdic to ascii.
Free Online EBCDIC to ASCII Text Converter

The dd (data definition) utility can do the conversion. google for more information
PHP Code:
man dd 
or use
Code:
dd ebsidic.

---------- Post updated at 10:50 AM ---------- Previous update was at 10:41 AM ----------

For example, to read an EBCDIC tape on tape device /dev/rmt0 and convert it to ASCII, putting the output in file was_ibm :
% dd if=/dev/rmt0 of=was_ibm ibs=800 cbs=80 conv=ascii
dd reads standard input and writes to standard output, but if you want to specify file or device names, you can use the fairly non-standard if= and of= options to specify the input file and output file, respectively.
If you wanted to convert the other way, you could use this command:
# 3  
Old 02-27-2012
Thank you for update,
I have wrote the dd script and the out put text like

Script :
Code:
dd if=<SRCPATH>yyy.xxx.RB065 of=<SRCPATH>/output.csv ibs=800 cbs=80 conv=ascii,lcase;

But the ouput like below but it's not readable format.

Code:
040101              01B0040101              01P0040101              07B0040101  
            07P0040101              09B0040101              09P0040101          
    10B0040101              10P0040102              01B0040102              01P0
040102              09B0040102              09P0040102              10B0040102  
            10P0040103              01B0040103              01P0040103          
    09B0040103              09P0040103              10B0040103              10P0

# 4  
Old 02-27-2012
Quote:
The source having the binary IBM file format
The conversion in "dd" is only suitable for simple character files in EBCDIC (256 character set). It is not suitable for binary files.
I expect that it's going to be much easier to export in ASCII text file format on the source computer.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Check if file is EBCDIC or ASCII format

So, i have this requirement where i need to check the file format, whether it's EBCDIC or ASCII, and based on format retrieve the information from that file: my file is: file1.txt-->this ebcdic file file2.txt-->ascii file i tried below code: file=file1.txt type="`file $file`" i get... (7 Replies)
Discussion started by: gnnsprapa
7 Replies

2. Shell Programming and Scripting

Normal text to table format

Hi, I am trying to show my list, from a simple list format to a table (row and column formatted table) Currently i have this format in my output (the formart it will always be like this ) >> first 3 lines must be on the same line aligned, and the next 3 shud be on 2nd line....: INT1:... (10 Replies)
Discussion started by: eboye
10 Replies

3. Shell Programming and Scripting

EBCDIC Format to ASCII

Hi, we have source file with EBCDIC format(Main Frame files) where we receving from source system. I would like to convert the EBCDIC format file to unix systemformat(ex: .csv,txt ) I have wrote script like: dd if=<SRCPATH>yyy.xxx.RB065 of=<SRCPATH>/output.csv ibs=800 cbs=80... (8 Replies)
Discussion started by: koti_rama
8 Replies

4. Shell Programming and Scripting

How to format String in ksh

Hi, I have 3 columns to display to target file and the display of the columns with specified position in target file. I have tried with printf command The Columns position like: Column1= 0 to 30 Column2=30 to 60 Column3=60 to 90 The source data: EMPNO,ENAME,SAL 1,11,100 2,22,200... (4 Replies)
Discussion started by: koti_rama
4 Replies

5. UNIX for Dummies Questions & Answers

Help! EBCDIC format to ASCII

Hi everyone, I have a 70MB EBCDIC file, with record length 102, block size 32742 and IBM standard label. I commanded dd if=input file of=outputfie ibs=32742 cbs=102 conv=ascii but I still don't get a viewable file under ASCII. Can anyone told me what's the problem? Do I need... (12 Replies)
Discussion started by: hrchl86
12 Replies

6. UNIX for Dummies Questions & Answers

Normal format and scientific combined data

hi guys, i have a data with a column of p value (normal format and scientific combined). i want to creat a subset of data which only contains p-value: data 1: p<10^7 data 2: p<0.01 how should i do it? many thanks! data looks like: rs7841347 128887490 1.695e-007 rs1241347 ... (4 Replies)
Discussion started by: forevertl
4 Replies

7. Shell Programming and Scripting

format string output

I need to put the output of the ps -ef command into a string. echo'n that string must display the output similiar to how we see the output of ps -ef in commandline. This is the string message="this is the output of ps command\n\n `ps -ef`\n\n Output Complete" when I echo $message the... (11 Replies)
Discussion started by: Northpole
11 Replies

8. Shell Programming and Scripting

format a string

Hello All, I have a file which appears as follows a,alpha,abc-xyz,123 b,beta,prq-jkl,543 c,gamma,xyz-mno,957 I have to extract the entire content, except for the data following "-" in the third column. Output should appear as follows. a,alpha,abc,123 b,beta,prq,543... (2 Replies)
Discussion started by: grajp002
2 Replies

9. Shell Programming and Scripting

write in ebcdic format

Hi - Is there a way to write the data in the ebcdic format. I mean I already have one file in the ebcdic format and I have to add a couple of rows to it in the ebcdic format. could any one please let me know how can I do that. (1 Reply)
Discussion started by: ahmedwaseem2000
1 Replies

10. Shell Programming and Scripting

Convert Epoch time format to normal date time format in the same file

I have a file named "suspected" with series of line like these : {'protocol': 17, 'service': 'BitTorrent KRPC', 'server': '219.78.120.166', 'client_port': 52044, 'client': '10.64.68.44', 'server_port': 8291, 'time': 1226506312L, 'serverhostname': ''} {'protocol': 17, 'service': 'BitTorrent... (3 Replies)
Discussion started by: rk4k
3 Replies
Login or Register to Ask a Question