03-25-2009
try with bzeroing req_msg before following statement.
Quote:
sprintf(req_msg, "%s%s%s%s", req_line1,req_line2,req_line3,req_line4);
- Dheeraj
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello Friends,
I have a problem with install.can u tell me how can I install a programm?I use AIX(IBM) system.
And how can i access cd-rom?I can't mounted,coz i am not Root.(can u tell me another Command /way)?
Thanks all. (1 Reply)
Discussion started by: Christianto
1 Replies
2. Programming
I have the programm, that says to STDERR(not to STDOUT!): "hello world!" and this programm is compiled and I have no sources.
When I try to open this programm in another using C:
=======================================
FILE *pp = popen("hello_to_stderr.exe", "r");
int c;
string a;
... (2 Replies)
Discussion started by: shalmoo
2 Replies
3. UNIX for Advanced & Expert Users
Dear friends,
I have hexadecimal data like this.
now i want to read each letter and convert to decimal format.
for example.:
from the below data first i have to read hex data 0 and convert to 4 bit decimal value ie 0000.
similarly second letter 8 decimal value is 1000.
like this.... (6 Replies)
Discussion started by: rajan_ka1
6 Replies
4. Shell Programming and Scripting
Hi,
How to embeded programme within perl programme.
Shankarao (2 Replies)
Discussion started by: shankarao
2 Replies
5. Programming
Hi All,
My main intension of is to convert the Hexstring stored in a char* into hex and then prefixing it with "0x" and suffix it with ','
This has to be done for all the hexstring char* is NULL.
Store the result prefixed with "0x" and suffixed with ',' in another char* and pass it to... (1 Reply)
Discussion started by: rvan
1 Replies
6. Shell Programming and Scripting
Hello All,
I have a requirement where I need to replaced the hex character - '\x0D' with 2 hex characters - 'x0D' & 'x0A'
I am trying to use SED -
But somehow its not working. Any pointers?
Also the hex character '\x0D' can occur anywhere in the line.
Can this also be accomplished... (6 Replies)
Discussion started by: paragkalra
6 Replies
7. Shell Programming and Scripting
Hi,
I have files that has got ebcdic character set and also, there are fields like binary and hex fields. is there a way to convert this to normal ascii data by taking care of comp & comp-3 fields?
Many Thanks!! (10 Replies)
Discussion started by: ahmedwaseem2000
10 Replies
8. Programming
Hi,
Is there really a difference between these two, std::hex and ios::hex??
I stumbled upon reading a line, "std::ios::hex is a bitmask (8 on gcc) and works with setf(). std::hex is the operator". Is this true?
Thanks (0 Replies)
Discussion started by: royalibrahim
0 Replies
9. Shell Programming and Scripting
I have a binary (hex) file I need to parse to get some data which are encoded this way:
.* b4 . . . 01 12 .* af .* 83 L1 x1 x2 xL 84 L2 y1 y2 yL
By another words there is a stream of hexadecimal bytes (in my example separated by space for better readability). I need to get value stored in... (3 Replies)
Discussion started by: sameucho
3 Replies
10. Shell Programming and Scripting
Hi Forum.
I'm running the following awk command to extract the suffix value (pos 38) from the "AM00" record and append to the end of the "AM01" record.
awk 'substr($0,13,4)=="AM00" {SUFFIX = substr($0,38,2)} substr($0,13,4)=="AM01" {$0 = $0 SUFFIX} 1' before.txt > after.txt
Before.txt:... (2 Replies)
Discussion started by: pchang
2 Replies
FSCANF(3) 1 FSCANF(3)
fscanf - Parses input from a file according to a format
SYNOPSIS
mixed fscanf (resource $handle, string $format, [mixed &$...])
DESCRIPTION
The function fscanf(3) is similar to sscanf(3), but it takes its input from a file associated with $handle and interprets the input
according to the specified $format, which is described in the documentation for sprintf(3).
Any whitespace in the format string matches any whitespace in the input stream. This means that even a tab in the format string can
match a single space character in the input stream.
Each call to fscanf(3) reads one line from the file.
PARAMETERS
o $handle
-A file system pointer resource that is typically created using fopen(3).
o $format
- The specified format as described in the sprintf(3) documentation.
o $...
- The optional assigned values.
RETURN VALUES
If only two parameters were passed to this function, the values parsed will be returned as an array. Otherwise, if optional parameters are
passed, the function will return the number of assigned values. The optional parameters must be passed by reference.
EXAMPLES
Example #1
fscanf(3) Example
<?php
$handle = fopen("users.txt", "r");
while ($userinfo = fscanf($handle, "%s %s %s
")) {
list ($name, $profession, $countrycode) = $userinfo;
//... do something with the values
}
fclose($handle);
?>
Example #2
Contents of users.txt
javier argonaut pe
hiroshi sculptor jp
robert slacker us
luigi florist it
SEE ALSO
fread(3), fgets(3), fgetss(3), sscanf(3), printf(3), sprintf(3).
PHP Documentation Group FSCANF(3)