|
Home > Archive > Unix administration > December 2007 > Insert Hex '0A' into a DAT FILE using C under unix.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Insert Hex '0A' into a DAT FILE using C under unix.
|
|
| PowerOne 2007-12-15, 1:21 pm |
| Hi,
I need to replace a char into a DAT FILE with '0A' using C under Unix
system.
I have a list of .dat file to do this work and I want to open the file
search for 0D and
replace it with 0D 0A (HEX) and go for the next file.
Can someone help me?
| |
|
| Begin <7f7cd19a-14d2-4a22-a2f1-f8ac2f3f2602@l32g2000hse.googlegroups.com>
On Sat, 15 Dec 2007 08:08:39 -0800 (PST), PowerOne <salazar.willy@gmail.com> wrote:
> I need to replace a char into a DAT FILE with '0A' using C under Unix
> system. I have a list of .dat file to do this work and I want to open
> the file search for 0D and replace it with 0D 0A (HEX) and go for the
> next file.
If it is truly a data file, then inserting as you describe but not as
you said you wanted to do, will likely break the file. If it is a text
file after all, then there already exist tools to do that. unix2dos
comes to mind.
If it is homework, then figuring out how to do it is part of the excercise.
--
j p d (at) d s b (dot) t u d e l f t (dot) n l .
This message was originally posted on Usenet in plain text.
Any other representation, additions, or changes do not have my
consent and may be a violation of international copyright law.
| |
| Dave Hinz 2007-12-15, 1:21 pm |
| On Sat, 15 Dec 2007 08:08:39 -0800 (PST), PowerOne <salazar.willy@gmail.com> wrote:
> Hi,
>
> I need to replace a char into a DAT FILE with '0A' using C under Unix
> system.
> I have a list of .dat file to do this work and I want to open the file
> search for 0D and
> replace it with 0D 0A (HEX) and go for the next file.
When is your homework due?
|
|
|
|
|