Am not able to display the corresponding character for the hex value using the format specifier into a file
Could you please help me with that
>cat other
a|\xc2\xbo
>cat write.pl
#! /opt/third-party/bin/perl
open(FILE2, "< other") || die "Unable to open file other\n";
while (... (7 Replies)
Hey guys,
I have this file generated by me... i want to create some HTML output from it.
The problem is that i am really confused about how do I go about reading the file.
The file is in the following format:
TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
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)
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)
Hi,
I want to split/parse certain bits of the hex data into another field.
Example:
Input data is
Word1: 4f72abfd
Output:
Parse bits (5 to 0) into field word1data1=0x00cd=205 decimal
Parse bits (7 to 6) into field word1data2=0x000c=12 decimal
etc.
Word2: efff3d02
Parse bits (13 to... (1 Reply)
I have a one CSV File Contain Hex Value
here is a sample file
6300, 0x0, 0x60d0242c6, , 0x728e5806, unnamedImageEntryPoint_0x728e5806, 0x728e$
6300, 0x0, 0x60d024c52, , 0x728e8cb7, unnamedImageEntryPoint_0x728e8cb7, 0x728e$
6300, 0x0, 0x60d025638, , 0x728e82da,... (2 Replies)
Hi guys,
First off, i'm a complete noob to UNIX and LINUX so apologies if I don't understand the basics!
I have a file which contains a hex value of '0D' at the end of each line when I look at it in a hex viewer.
I need to change it so it contains a hex value of '0D0A0A'
I thought... (10 Replies)
dHi,
I have the attached file(actual file can be extracted post unzipping it) & i am trying to use the following code for coversion to hex format.
Starting hex value is 84 which is start of the record & termination is done using 00 00 followed by 84(hex) which i can see in the dump clearly using... (14 Replies)
Hello there,
I've been trying to do this half of the day and it's like I haven't come a single step further, so I hope you guys can help me with my problem:
I have a text file that contains strings that should not be there and which I want to delete automatically from the command line. The... (4 Replies)
Discussion started by: surfi
4 Replies
LEARN ABOUT SUNOS
freopen
fopen(3UCB) SunOS/BSD Compatibility Library Functions fopen(3UCB)NAME
fopen, freopen - open a stream
SYNOPSIS
/usr/ucb/cc[ flag ... ] file ...
#include <stdio.h>
FILE *fopen( file, mode);
const char *file, *mode;
FILE *freopen(file, mode, iop);
const char *file, *mode;
register FILE *iop;
DESCRIPTION
The fopen() function opens the file specified by file and associates a stream with it. If the open succeeds, fopen() returns a pointer to
be used to identify the stream in subsequent operations. The file argument points to a character string that contains the name of the file
to be opened. The mode argument is a character string having one of the following values:
r open for reading
w truncate or create for writing
a append: open for writing at end of file, or create for writing
r+ open for update (reading and writing)
w+ truncate or create for update
a+ append; open or create for update at EOF
The freopen() function opens the file specified by file and associates the stream pointed to by iop with it. The mode argument is used just
as in fopen(). The original stream is closed, regardless of whether the open ultimately succeeds. If the open succeeds, freopen() returns
the original value of iop.
The freopen() function is typically used to attach the preopened streams associated withstdin, stdout, and stderr to other files.
When a file is opened for update, both input and output can be performed on the resulting stream. Output cannot be directly followed by
input without an intervening fseek(3C) or rewind(3C). Input cannot be directly followed by output without an intervening fseek(3C) or
rewind(3C). An input operation that encounters EOF will fail.
RETURN VALUES
The fopen() and freopen() functions return a NULL pointer on failure.
USAGE
The fopen() and freopen() functions have transitional interfaces for 64-bit file offsets. See lf64(5).
SEE ALSO open(2), fclose(3C), fopen(3C), freopen(3C), fseek(3C), malloc(3C), rewind(3C), lf64(5)NOTES
Use of these functions should be restricted to applications written on BSD platforms. Use of these functions with any of the system
libraries or in multithreaded applications is unsupported.
To support the same number of open files as the system, fopen() must allocate additional memory for data structures using malloc(3C) after
64 files have been opened. This confuses some programs that use their own memory allocators.
The fopen() and freopen() functions differ from the standard I/O functions fopen(3C) and freopen(3C). The standard I/O functions distin-
guish binary from text files with an additional use of 'b' as part of the mode, enabling portability of fopen(3C) and freopen(3C) beyond
SunOS 4.x systems.
SunOS 5.10 22 Jan 1993 fopen(3UCB)