awk and EBCDIC


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting awk and EBCDIC
# 1  
Old 04-14-2009
awk and EBCDIC

Hello,

I am trying to insert a line in an EBCDIC encoded file.
I intend to translate my ASCII line into EBCDIC, then use awk to insert this line into my file after it found a known EBCDIC occurence within the file (contained in a control file, in EBCDIC).

But I am having difficulties telling awk to locate that pattern, as it always returns me no result even if I negate the special characters contained in it.

The pattern looks like this:
Code:
Ù^Å¢^Ö¤^Ù^Ã^ÅÇäÉÄ~ùøö^Á^Äùô^Áùô^Æóô^Áñ^Â^Â^Áð÷^Âõ^Æ^Áð^Ãö÷^Á^Åøð

And it is confirmed to be part of the file I am trying to amend.

My question is if there would be a way to tell awk to take this EBCDIC pattern line "as if" other than using the \ character since it doesn't seem to work)?

Any advice on using sed/perl/grep are welcome too as I can use these programs.
# 2  
Old 04-14-2009
Awk & EBCDIC

Why not convert all your EBCDIC to ASCII, do your AWK stuff, then convert it all back to EBCDIC?

IIRC, dd man dd(1M) may help in EBCDIC->ASCII conversion

Rgds
# 3  
Old 04-15-2009
This file cannot be converted to ASCII so I have to treat it as EBCDIC from start to the end.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

EBCDIC to ASCII conversion

Hi, We have a mainframe file which is in EBCDIC format.We dont have direct access to mainframe ,client has provided us the mainframe file.The mainframe file is containing pact data(COMP1 ,COMP2 etc) which are unreadble.Can anyone suggest me how to convert this kind of ebcdic file to ascii... (11 Replies)
Discussion started by: swapna_1990
11 Replies

2. UNIX for Advanced & Expert Users

EBCDIC to ASCII conversion

Hi, I have a input file which is EBCIDIC and it has packed decimals. Can anyone help me to convert EBCIDIC file to ASCII(Need to convert even Packed decimal values also to normal format). Thanks swapna (12 Replies)
Discussion started by: swapna_1990
12 Replies

3. Programming

Ebcdic to ascii

Hi, I want to convert ebcdic values to ascii values. Are there anyany specific c++ libraries with g++ compiler, which can do it ? gcc version 4.1.2 20080704 (Red Hat 4.1.2-54) (19 Replies)
Discussion started by: tostay2003
19 Replies

4. 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

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

Conversion from EBCDIC to ASCII

when i try to convert a mainframe EBCDIC file to ASCII ,i dont see correct file this is the source file ... (3 Replies)
Discussion started by: venkatvelpula
3 Replies

7. UNIX for Dummies Questions & Answers

Conversion from EBCDIC to HEX

Hello, Is there any utility around able to deal with the conversion of some EBCDIC coded string into an hexadecimal value? Thanks (1 Reply)
Discussion started by: Indalecio
1 Replies

8. Shell Programming and Scripting

ascii to ebcdic conversion

Hello, I need a program for ascii to ebsdic conversion. If anybody can help, it'll be greatly appreciated. Thanks. (1 Reply)
Discussion started by: er_ashu
1 Replies

9. Shell Programming and Scripting

Comparing EBCDIC files

Hi Guys, I wish to compare two ebcdic files. diff utility manual says it only compares two text files line by line.. I doubt this will be good for ebcdic files. cmp utility does binary comparision but I do not find any thing in manual referring if it does support ebcdic file format. let... (2 Replies)
Discussion started by: RishiPahuja
2 Replies

10. UNIX for Dummies Questions & Answers

Unix to EBCDIC conversion

Hi, I am using HPUX 11. There is a command to convert Unix formatted data to Dos formatted data called 'ux2dos'. Is there a similar command to convert Unix formatted data to EBCDIC format? Many thanks Helen :) (2 Replies)
Discussion started by: Bab00shka
2 Replies
Login or Register to Ask a Question