Sponsored Content
Top Forums UNIX for Advanced & Expert Users Converting Binary decimal coded values to Ascii Values Post 302180448 by gaur.deepti on Monday 31st of March 2008 08:46:29 AM
Old 03-31-2008
Hi ,

I have tried the below things but i am getting the output as all numbers


dd if=inputfile of=test.dat ibs=512 cbs=0 conv=ascii
dd conv=ascii | od -c inputfile > test.dat

i am getting the below values

0000140 4149 4c4c 474d 412e 3946 4939 4942 302e
0000160 3630 3133 3930 0333 4500 5888 8e82 eeee
0000200 eeee eeee eeee 0299 0075 0063 0000 3208
0000220 8888 ee73 eeee 0eee 0e0e 300e 0e03 e863

the above values contains varchar and date columns which i am not able to see

pls suggest any other way

Thanks,
Deepti.Gaur
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

unix script for converting a decimal to binary

Could anybody please help me in writing a script in unix for converting a decimal number to binary number. (3 Replies)
Discussion started by: softy
3 Replies

2. UNIX for Advanced & Expert Users

Converting ASCII to Binary mode

Dear All, Business Users are transfering ( FTP ) a CSV file into the IBM AIX box with transfer mode as ASCII. But I want to convert the CSV file from ASCII mode into binary mode, as my script expects file in binary mode. Is it possible to do through Unix commands? Thanks in Advance, RK (1 Reply)
Discussion started by: srajeshmca
1 Replies

3. Shell Programming and Scripting

convert ascii values into ascii characters

Hi gurus, I have a file in unix with ascii values. I need to convert all the ascii values in the file to ascii characters. File contains nearly 20000 records with ascii values. (10 Replies)
Discussion started by: sandeeppvk
10 Replies

4. UNIX for Dummies Questions & Answers

Decimal to BCD (Binary Coded Decimal)

Anybody please help me... Design an algorithm that accepts an input a decimal number and converts it into BCD (Binary Coded Decimal) representation. Also, draw its Flow Chart. This is a unix qn... plz post algorithm for that :confused: (1 Reply)
Discussion started by: caramba
1 Replies

5. Homework & Coursework Questions

Decimal to BCD (Binary Coded Decimal)

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Design an algorithm that accepts an input a decimal number and converts it into BCD (Binary... (2 Replies)
Discussion started by: caramba
2 Replies

6. Shell Programming and Scripting

Converting hex to ascii/decimal

I am writing a bash script to do some parsing on a log and I am running into a problem when it comes to converting only certain sections of the file from hex to ascii or hex to decimal. Data Example: The hex values after Hardware and SW Version I need to convert from Hex to ASCII and the... (16 Replies)
Discussion started by: Shiftkey
16 Replies

7. Shell Programming and Scripting

Converting odd values to even values(or vice-versa) located in a column

Hello All, I have a below data in a .csv file where all rows where col1 is A, col2 is odd numbers, similarly even numbers for all rows where col1 is B. Note that my data has some other columns(not shown here) too (around 100) after col2. Tool,Data A,1 A,3 A,5 .... so on B,2 B,4 .... ... (4 Replies)
Discussion started by: ks_reddy
4 Replies

8. Shell Programming and Scripting

Converting a binary file to ascii and vice versa?

Hi All, I have a binary file which is being exported from a Database, and i need to convert that to ASCII format. How can i achieve that? And this solution should work for any file which is given to us; means they will give different files from different tables. Thanks in advance. (8 Replies)
Discussion started by: baranisachin
8 Replies

9. Shell Programming and Scripting

awk file to read values from Db2 table replacing hard coded values

Hi, I want to replace a chain of if-else statement in an old AWK file with values from Db2 table or CSV file. The part of code is below... if (start_new_rec=="true"){ exclude_user="false"; user=toupper($6); match(user, "XXXXX."); if (RSTART ==2 ) { ... (9 Replies)
Discussion started by: asandy1234
9 Replies
DD(1)							      General Commands Manual							     DD(1)

NAME
dd - convert and copy a file SYNOPSIS
dd [option=value] ... DESCRIPTION
Dd copies the specified input file to the specified output with possible conversions. The standard input and output are used by default. The input and output block size may be specified to take advantage of raw physical I/O. option values if= input file name; standard input is default of= output file name; standard output is default ibs=n input block size n bytes (default 512) obs=n output block size (default 512) bs=n set both input and output block size, superseding ibs and obs; also, if no conversion is specified, it is particularly effi- cient since no copy need be done cbs=n conversion buffer size skip=n skip n input records before starting copy files=n copy n files from (tape) input seek=n seek n records from beginning of output file before copying count=n copy only n input records conv=ascii convert EBCDIC to ASCII ebcdic convert ASCII to EBCDIC ibm slightly different map of ASCII to EBCDIC lcase map alphabetics to lower case ucase map alphabetics to upper case swab swap every pair of bytes noerror do not stop processing on an error sync pad every input record to ibs ... , ... several comma-separated conversions Where sizes are specified, a number of bytes is expected. A number may end with k, b or w to specify multiplication by 1024, 512, or 2 respectively; a pair of numbers may be separated by x to indicate a product. Cbs is used only if ascii or ebcdic conversion is specified. In the former case cbs characters are placed into the conversion buffer, con- verted to ASCII, and trailing blanks trimmed and new-line added before sending the line to the output. In the latter case ASCII characters are read into the conversion buffer, converted to EBCDIC, and blanks added to make up an output record of size cbs. After completion, dd reports the number of whole and partial input and output blocks. For example, to read an EBCDIC tape blocked ten 80-byte EBCDIC card images per record into the ASCII file x: dd if=/dev/rmt0 of=x ibs=800 cbs=80 conv=ascii,lcase Note the use of raw magtape. Dd is especially suited to I/O on the raw physical devices because it allows reading and writing in arbitrary record sizes. To skip over a file before copying from magnetic tape do (dd of=/dev/null; dd of=x) </dev/rmt0 SEE ALSO
cp(1), tr(1) DIAGNOSTICS
f+p records in(out): numbers of full and partial records read(written) BUGS
The ASCII/EBCDIC conversion tables are taken from the 256 character standard in the CACM Nov, 1968. The `ibm' conversion, while less blessed as a standard, corresponds better to certain IBM print train conventions. There is no universal solution. Newlines are inserted only on conversion to ASCII; padding is done only on conversion to EBCDIC. These should be separate options. DD(1)
All times are GMT -4. The time now is 11:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy