10-23-2002
Take a look at the man pages for printf() and scanf().
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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
2. UNIX for Dummies Questions & Answers
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... (0 Replies)
Discussion started by: bubba112557
0 Replies
3. Programming
Hi All,
Please suggest me how to read a binary file in text or ASCII format.
thanks
Nagendra (3 Replies)
Discussion started by: Nagendra
3 Replies
4. Programming
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
5. Shell Programming and Scripting
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
6. Shell Programming and Scripting
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
Input file (each line is separaed by spaces )given below:
Name Domain Contact Phone Email Location
----------------------- ------------------------------------------------ ------- -----... (18 Replies)
Discussion started by: sreenath1037
18 Replies
8. Solaris
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
9. Shell Programming and Scripting
Hello *nix specialists,
Im working for a non profit organisation in Germany to transport DSL over WLAN to people in areas without no DSL. We are using Linksys WRT 54 router with DD-WRT firmware There are at the moment over 180 router running but we have to change some settings next time. So my... (7 Replies)
Discussion started by: digidax
7 Replies
10. Shell Programming and Scripting
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
scanf(3int) scanf(3int)
Name
scanf, fscanf, sscanf - convert formatted input
Syntax
#include <stdio.h>
int scanf( format [, pointer ] ... )
char *format;
int fscanf( stream, format [, pointer ] ... )
FILE *stream;
char *format;
int sscanf( s, format [, pointer ] ... )
char *s, *format;
Description
The international functions and are similar to the standard I/O functions. The difference is that the international functions allow you to
use the %digit$ conversion character in place of the I% character you use in the standard I/O functions. The digit is a decimal digit n
from 1 to 9. The international functions apply conversions to the n th argument in the argument list, rather than to the next unused argu-
ment.
You can use % conversion character in the international functions. However, you cannot mix the % conversion character with the %digit$
conversion character in a single call.
In all cases, uses the radix character and collating sequence that is defined by the last successful call to category or If the radix or
collating sequence is undefined, the function uses the C locale definitions.
International Environment
LC_COLLATE Contains the user requirements for language, territory, and codeset for the character collation format. affects the behav-
ior of regular expressions and the string collation functions in If is not defined in the current environment, provides the
necessary default.
LC_NUMERIC If this environment is set and valid, uses the international language database named in the definition to determine radix
character rules.
LANG If this environment variable is set and valid uses the international language database named in the definition to determine
collation and character classification rules. If or is defined, their definitions supersede the definition of LANG.
Examples
The following shows an example of using the function:
scanf("%2$s %1$d", integer, string)
If the input is `` january 9 '', the function assigns 9 to and ``january'' to
Return Values
The function returns the number of successfully matched and assigned input fields. This number can be zero if the function encounters
invalid input characters, as specified by the conversion specification, before it can assign input characters.
If the input ends before the first conflict or conversion, returns EOF. These functions return EOF on end of input and a short count for
missing or invalid data items.
Environment
In POSIX mode, the E, F, and X formats are treated the same as the e, f, and x formats, respectively; otherwise, the upper-case formats
expect double, double, and long arguments, respectively.
See Also
intro(3int), setlocale(3), strtod(3), strtol(3), printf(3int), getc(3s), printf(3s), scanf(3s)
Guide to Developing International Software
scanf(3int)