Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Eliminate Header and footer from EBCDIC file Post 302929123 by Don Cragun on Thursday 18th of December 2014 04:48:46 AM
Old 12-18-2014
I suggested using dd or iconv. Did you try either of them? Is the data from your mainframe in fixed length records. If so use something like:
Code:
dd if=YourInputFile conv=ascii cbs=FixedLengthRecordSize

If not, use something like:
Code:
iconv -f fromcode YourInputFile

where fromcode is a code chosen from the output of the command:
Code:
iconv -l

for an EBCDIC codeset.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to Chop Header and Footer record from input file

Hi, I need to chope the header and footer record from an input file and make a new output file, please let me know how i can do it in unix.thanks. (4 Replies)
Discussion started by: coolbudy
4 Replies

2. Shell Programming and Scripting

Total of lines w/out header and footer incude for a file

I am trying to get a total number of tapes w/out headers or footers in a ERV file and append it to the file. For some reason I cannot get it to work. Any ideas? #!/bin/sh dat=`date +"%b%d_%Y"` + date +%b%d_%Y dat=Nov16_2006 tapemgr="/export/home/legato/tapemgr/rpts"... (1 Reply)
Discussion started by: gzs553
1 Replies

3. Shell Programming and Scripting

Split large file and add header and footer to each file

I have one large file, after every 200 line i have to split the file and the add header and footer to each small file? It is possible to add different header and footer to each file? (1 Reply)
Discussion started by: ashish4422
1 Replies

4. Shell Programming and Scripting

Split large file and add header and footer to each small files

I have one large file, after every 200 line i have to split the file and the add header and footer to each small file? It is possible to add different header and footer to each file? (7 Replies)
Discussion started by: ashish4422
7 Replies

5. Shell Programming and Scripting

sort a report file having header and footer

I am having report file with header and footer . The details in between header and footer are separated by a pipe charater. I want to sort the file by considering multiple columns in between header and footer. pls help (4 Replies)
Discussion started by: suryanarayana
4 Replies

6. Shell Programming and Scripting

Add header and footer with record count in footer

This is my file(Target.txt) name|age|locaction abc|23|del xyz|24|mum jkl|25|kol The file should be like this 1|03252012 1|name|age|location 2|abc|23|del 2|xyz|24|mum 2|jkl|25|kol 2|kkk|26|hyd 3|4 Column 1 is row indicator for row 1 and 2, column indicator is 1,for data rows... (1 Reply)
Discussion started by: itsranjan
1 Replies

7. Shell Programming and Scripting

Removing header or footer from file

Hi Every one, what is the coomand to remove header or footer from a file. Please help me by providing command/syntax to remove header/footer from unix. Thanks in advance for all your support. (5 Replies)
Discussion started by: sridhardwh
5 Replies

8. Shell Programming and Scripting

Is there a way to append both at header and footer of a file

currently I've a file Insert into CD_CARD_TYPE (CODE, DESCRIPTION, LAST_UPDATE_BY, LAST_UPDATE_DATE) Values ('024', '024', 2, sysdate); Insert into CD_CARD_TYPE (CODE, DESCRIPTION, LAST_UPDATE_BY, LAST_UPDATE_DATE) Values ('032', '032', 2, sysdate); ........ is it... (3 Replies)
Discussion started by: jediwannabe
3 Replies

9. UNIX for Dummies Questions & Answers

File Row Line Count without Header Footer

Hi There! I am saving the file count of all files in a directory to an output file using: wc -l * > FileCount.txt I get: 114 G4SXORD 3 G4SXORH 0 G4SXORP 117 total But this count includes header and footer. I want to subtract 2 from the count and get ... (7 Replies)
Discussion started by: gagan8877
7 Replies

10. UNIX for Advanced & Expert Users

Removing Header and Trailer record of a EBCDIC file

I have a EBCDIC multi layout file which has a header record which is 21 bytes, The Detail records are 2427 bytes long and the trailer record is 9 bytes long. Is there a command to remove the header as well as trailer record and read only the detail records while at the same time not altering... (1 Reply)
Discussion started by: abhilashnair
1 Replies
iconv(1)							   User Commands							  iconv(1)

NAME
iconv - code set conversion utility SYNOPSIS
iconv [-cs] -f frommap -t tomap [file]... iconv -f fromcode [-cs] [-t tocode] [file]... iconv -t tocode [-cs] [-f fromcode] [file]... iconv -l DESCRIPTION
The iconv utility converts the characters or sequences of characters in file from one code set to another and writes the results to stan- dard output. If no conversion exists for a particular character, an implementation-defined conversion is performed on this character. The list of supported conversions and the locations of the associated conversion tables are provided in the iconv(5) manual page. OPTIONS
The following options are supported: -c Omits any characters that are invalid in the codeset of the input file from the output. When -c is not used, the results of encountering invalid characters in the input stream depend on the specified codesets for the conversion. Invalid char- acters can be either those that are not valid characters in the codeset of the input file or those that have no corre- sponding character in the codeset of the output file. The presence or absence of -c does not affect the exit status of iconv. When fromcode is specified for the fromcodeset of the -f option or tocode is specified for the tocodeset of the -t option, the specification of -c may be ignored. -f fromcodeset Identifies the code set of the input file. The following two forms of the fromcodeset option-argument are recognized: fromcode The fromcode option-argument must not contain a slash (/) character. It is interpreted as the name of one of the codeset descriptions. frommap The frommap option-argument must contain a slash character. It is interpreted as the pathname of a charmap file as defined in charmap(5). If the pathname does not represent a valid, readable charmap file, the results are undefined. If this option is omitted, the codeset of the current locale is used. -l Writes all supported fromcode and tocode values to standard output. -s Suppresses any messages written to standard error concerning invalid characters. When -s is not used, the results of encountering invalid characters in the input stream depend on the specified codesets for the conversion. Invalid charac- ters can be either those that are not valid characters in the codeset of the input file or those that have no correspond- ing character in the codeset of the output file. The presence or absence of -s does not affect the exit status of iconv. When fromcode is specified for the fromcodeset of the -f option or tocode is specified for the tocodeset of the -t option, the specification of -s may be ignored. -t tocodeset Identifies the code set used for the output file. The following two forms of the tocodeset option-argument are recog- nized: tocode The tocode option-argument must not contain a slash (/) character. It is interpreted as the name of one of the codeset descriptions. tomap The tomap option-argument must contain a slash character. It is interpreted as the pathname of a charmap file as defined in charmap(5). If the pathname does not represent a valid, readable charmap file, the results are undefined. If this option is omitted, the codeset of the current locale is used. If either -f or -t represents a charmap file but the other does not, or is omitted, or if both -f and -t are omitted, iconv fails as an error. OPERANDS
The following operands are supported: file A path name of an input file. If no file operands are specified, or if a file operand is '-', the standard input is used. EXAMPLES
Example 1 Converting and storing files The following example converts the contents of file mail1 from code set 8859 to 646fr and stores the results in file mail.local: example% iconv -f 8859 -t 646fr mail1 > mail.local ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of iconv: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 Successful completion. 1 An error has occurred. FILES
/usr/lib/iconv/iconv_data list of conversions supported by conversion tables ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
iconv(3C), iconv_open(3C), attributes(5), charmap(5), environ(5), iconv(5), iconv_unicode(5), standards(5) NOTES
Make sure that both charmap files use the same symbolic names for characters the two codesets have in common. The output format of the -l option is unspecified. The -l option is not intended for shell script usage. When fromcode or tocode is specified for the codeset conversion, iconv uses the iconv_open(3C) function. If iconv_open(3C) fails to open the specified codeset conversion, iconv searches for an appropriate conversion table. As for the supported codeset conversion by iconv_open(3C), please refer to iconv(5) and iconv_locale(5). SunOS 5.11 14 Nov 2003 iconv(1)
All times are GMT -4. The time now is 03:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy