Sponsored Content
Full Discussion: File conversion to ascii
Top Forums UNIX for Advanced & Expert Users File conversion to ascii Post 302180479 by mora on Monday 31st of March 2008 10:19:16 AM
Old 03-31-2008
Hello Jgt,

Thanks for your quick response.

The file was created in binary mode and ftp ed to our unix box.

The file is fixed width file and it has no negative numbers.

There are no data compressions as far as i know..

Pls give me little more details about hd command..that will be helpfull

-Mora
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ascii conversion

after converting my ebcidic file to ascii i get the following output 2097152+0 records in 1797345+1 records out Why is there a difference in number of records. Is the converson chopping off any records. All i am doing is just a conversion using the following script dd if=xaa cbs=152 ... (0 Replies)
Discussion started by: rintingtong
0 Replies

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

3. Shell Programming and Scripting

help needed with ASCII conversion

I have a file say "codefile" here ,contains data like this Hi! How are you? I need to covert this data into stram of equivalant ASCII values I wrote follwoing script. #!/bin/bash while read -n1 char do printf "%d" \'$char done < codefile this gives me output ... (4 Replies)
Discussion started by: sunilmenhdiratt
4 Replies

4. Shell Programming and Scripting

need help with ascii to decimal conversion

Hi, Can anyone please help me ascci to decimal conversion in bash I have a file which contains stream of numbers like this,these are ascci values 729711810132973278105991013268971213233 I want to covert it to its actual value like upper code's decimal is "Have a Nice Day!" ... (15 Replies)
Discussion started by: sunilmenhdiratt
15 Replies

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

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

ASCII to UTF-8 conversion

I Am trying to change the file encoding from ASCII to UTF-8 using below command iconv -f ASCII -t UTF-8 <input_file> > <output_file> But the output_file is not actually in UTF-8 format. If I use the file command to check the file encoding it still says ASCII. While converting am not... (5 Replies)
Discussion started by: Sriranga
5 Replies

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

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

10. 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
ADDR2ASCII(3)						   BSD Library Functions Manual 					     ADDR2ASCII(3)

NAME
addr2ascii, ascii2addr -- Generic address formatting routines LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <arpa/inet.h> char * addr2ascii(int af, const void *addrp, int len, char *buf); int ascii2addr(int af, const char *ascii, void *result); DESCRIPTION
The routines addr2ascii() and ascii2addr() are used to convert network addresses between binary form and a printable form appropriate to the address family. Both functions take an af argument, specifying the address family to be used in the conversion process. (Currently, only the AF_INET and AF_LINK address families are supported.) The addr2ascii() function is used to convert binary, network-format addresses into printable form. In addition to af, there are three other arguments. The addrp argument is a pointer to the network address to be converted. The len argument is the length of the address. The buf argument is an optional pointer to a caller-allocated buffer to hold the result; if a null pointer is passed, addr2ascii() uses a statically- allocated buffer. The ascii2addr() function performs the inverse operation to addr2ascii(). In addition to af, it takes two arguments, ascii and result. The ascii argument is a pointer to the string which is to be converted into binary. The result argument is a pointer to an appropriate network address structure for the specified family. The following gives the appropriate structure to use for binary addresses in the specified family: AF_INET struct in_addr (in <arpa/inet.h>) AF_LINK struct sockaddr_dl (in <net/if_dl.h>) AF_INET and AF_LINK constants are defined in <sys/socket.h> RETURN VALUES
The addr2ascii() function returns the address of the buffer it was passed, or a static buffer if the a null pointer was passed; on failure, it returns a null pointer. The ascii2addr() function returns the length of the binary address in bytes, or -1 on failure. EXAMPLES
The inet(3) functions inet_ntoa() and inet_aton() could be implemented thusly: #include <sys/socket.h> #include <arpa/inet.h> char * inet_ntoa(struct in_addr addr) { return addr2ascii(AF_INET, &addr, sizeof addr, 0); } int inet_aton(const char *ascii, struct in_addr *addr) { return (ascii2addr(AF_INET, ascii, addr) == sizeof(*addr)); } In actuality, this cannot be done because addr2ascii() and ascii2addr() are implemented in terms of the inet(3) functions, rather than the other way around. ERRORS
When a failure is returned, errno is set to one of the following values: [ENAMETOOLONG] The addr2ascii() routine was passed a len argument which was inappropriate for the address family given by af. [EPROTONOSUPPORT] Either routine was passed an af argument other than AF_INET or AF_LINK. [EINVAL] The string passed to ascii2addr() was improperly formatted for address family af. SEE ALSO
inet(3), linkaddr(3), inet(4) HISTORY
An interface close to this one was originally suggested by Craig Partridge. This particular interface originally appeared in the INRIA IPv6 implementation. AUTHORS
Code and documentation by Garrett A. Wollman, MIT Laboratory for Computer Science. BUGS
The original implementations supported IPv6. This support should eventually be resurrected. The NRL implementation also included support for the AF_ISO and AF_NS address families. The genericity of this interface is somewhat questionable. A truly generic interface would provide a means for determining the length of the buffer to be used so that it could be dynamically allocated, and would always require a ``struct sockaddr'' to hold the binary address. Unfortunately, this is incompatible with existing practice. This limitation means that a routine for printing network addresses from arbi- trary address families must still have internal knowledge of the maximum buffer length needed and the appropriate part of the address to use as the binary address. BSD
June 13, 1996 BSD
All times are GMT -4. The time now is 10:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy