Binary file conversion


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Binary file conversion
# 1  
Old 01-10-2006
Binary file conversion

All,

I want to convert multiple \0 005 characters to line feed 012 character
in a binary file to make to readable. Here is the sample od -c file
output:

0000000 254 355 \0 005 s r \0 * c o m . c i s c

Here is the sample od -b file output:

0000000 254 355 000 005 163 162 000 052 143 157 155 056 143 151 163 143

Thanks!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Conversion of Binary csv file

Hello, I have a binary csv file that was created on 'Red Hat Enterprise Linux Server release 6.6'. Now we have transferred all files on Ubuntu 16.04.2 LTS/xenial On opening the file in Ubuntu, there are special characters ... (8 Replies)
Discussion started by: nans
8 Replies

2. Shell Programming and Scripting

File conversion from Binary to ASCII though UNIX command

Hi All , I have a mainframe file which contains the data in EBCDIC format.I have downloaded this file from mainframe to windows in binary format(unreadable raw data).Now I want convert this file to ASCII format(readable format data) through Unix command.I have tried iconv but that is not working... (2 Replies)
Discussion started by: STCET22
2 Replies

3. Shell Programming and Scripting

Conversion from Hexadecimal to binary

How can I convert hexadecimal values to Binary from the second field to the end Input: WS-2 23 345 235 DT-3 45 4A3 000 pp-2 76 300 E4 Output: WS-2 100011 1101000101 1000110101 DT-3 1000101 10010100011 000 pp-2 1110110 1100000000 11100100 (16 Replies)
Discussion started by: aydj
16 Replies

4. Shell Programming and Scripting

Hexadecimal to Binary conversion

Hi Guys, Is it possible to convert the hexadecimal to Binary by unix command.....I could not figure out.... If I need to convert AF6D to binary...what could be the way to do? Thanks in advance!! ---------- Post updated at 02:57 AM ---------- Previous update was at 02:42 AM ---------- I... (6 Replies)
Discussion started by: Indra2011
6 Replies

5. Solaris

binary conversion

Why would a binary which was compiled on a Solaris-10 not be runnable in a SunOS 5.10? (they are supposed to be precisely equivalent). When I run the file command on it, it says: ELF 32-bit LSB executable 80386 Version 1, dynamically linked, not stripped, no debugging information available... (10 Replies)
Discussion started by: steve701
10 Replies

6. Shell Programming and Scripting

binary to ascii conversion

Hi, I have got a library file, created by compiling C code. The file information with "file" command, gives it a "application/x-archive" type file. I want to extract the release string of my software from this file, so that i can know which version of C files were used to create the lib. Can... (3 Replies)
Discussion started by: atulmt
3 Replies

7. Shell Programming and Scripting

binary file conversion

Hello folks, i have a binary text file but i am not able to convert into text format, please suggest. thanks. (2 Replies)
Discussion started by: learnbash
2 Replies

8. Programming

Binary conversion function

Is/are there any function(s) in C that convert(s) character/ASCII/Decimal to binary and vice versa? what about bcopy and strcpy? (1 Reply)
Discussion started by: Peevish
1 Replies

9. SCO

ascii to binary conversion in sco 5.0.5

Here is what I did . . . . I FTP'd several *.dbf zipped files from a SCO 5.0.5 server to winXP machine, and did not set the transfer mode to BIN, now when i was uncompressing these files in SCO 5.0.5 , it was giving "Bad Decode Table error. Is there a way to convert the *.dbf.Z files to Binary so... (1 Reply)
Discussion started by: sameek1211
1 Replies

10. UNIX for Dummies Questions & Answers

Binary data to text file conversion

Dear Sir; i want to know how the binary data convert to text file or readablw format (ASCII).If possible pl. help me for the software and where it is available for download. i.e. (1 Reply)
Discussion started by: auro123
1 Replies
Login or Register to Ask a Question
iconv(1)						      General Commands Manual							  iconv(1)

Name
       iconv - international codeset conversion

Syntax
       iconv [-d] -f fromcodeset -t tocodeset [file...]

Description
       The  command  converts the encoding of characters in its input from one codeset to another codeset.  The fromcodeset argument specifies the
       codeset used to encode the data in the input; that is, it specifies the input codeset.  The tocodeset argument  specifies  the  codeset	to
       which  you  want  the input data converted; that is, it specifies the output codeset.  The command performs the conversion by reading rules
       from a conversion table you create.  The command reads its input from standard input or from one or more files named on the  command  line.
       The command writes its output to standard output.

       You define conversion rules in a conversion table. The conversion rules specify how converts a particular character or group of characters,
       which are called tokens.  The conversion table is a text file that contains two lists.  In the left-hand list, you specify each	token  you
       want  to convert.  In the right-hand list, you specify the token you want to create in the output file. For example, if you issued the fol-
       lowing command:
       % iconv -fupper -tlower conversion_file

       This command uses the conversion table located in the file that specifies how to convert from an uppercase codeset to a lowercase  codeset.
       The following shows part of the conversion table:
       #
       # Converts from uppercase to lowercase
       #
       #    Input token 	Output token
       #    -------------	------------------
		 A		     a
		 B		     b
		 C		     c
		 D		     d
		 E		     e
		 F		     f
		 G		     g
		 .
		 .
		 .
		 Z		     z
       #
       # Convert tabs to spaces using octal
       #
		11		  404040
       #
       # Convert the A umlaut to lowercase
       #
		    A			    a

       Each  line  in the conversion table must contain two strings, an input token and an output token.  The tokens must be delimited with spaces
       or tabs.  The backslash character (  ) either causes the command to recognize a character it normally ignores or introduces a three  digit
       octal  constant.   All octal constants in the conversion table must contain three digits.  Lines that begin with a hash symbol (#) are com-
       ments.  The command ignores comment lines and blank lines.

       You name the conversion table file using the name of the input codeset, an underscore, and the name of the output codeset.  For example, if
       your input codeset is ISO646 and your output codeset is ISO8859, you might name the conversion table file

       The  command  searches  for  the conversion table file in the directory specified by the pathname.  If the ${ICONV} environment variable is
       undefined, the command searches the directory.

       The operation of the command is 8-bit transparent.

Options
       -d Deletes any characters that are omitted from the conversion table.  By default, the command sends characters that  are  omitted  to  the
	  output file without modifying them.

       -f Specifies the name of the input codeset.

       -t Specifies the name of the output codeset.

Restrictions
       The  conversion	table file name can contain no more than 255 characters.  You may need to truncate the name of the input codeset or output
       codeset when you name the conversion table file.

Examples
       The following shows an example of using the command:

       This command converts the data in from ISO646 encoding to ISO8859 encoding.  The command reads the conversion table from the file.  If  the
       ${ICONV} environment variable is undefined, the command uses the file. If that file does not exist, the command issues an error message and
       does not convert the data file.	The command writes the results	of any conversion it performs to the file

Files
See Also
       environ(5int)
       Guide to Developing International Software

																	  iconv(1)