Insert Hex '0A' into a DAT FILE using C under unix.
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > Insert Hex '0A' into a DAT FILE using C under unix.




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Insert Hex '0A' into a DAT FILE using C under unix.  
PowerOne


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-15-07 06: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?





[ Post a follow-up to this message ]



    Re: Insert Hex '0A' into a DAT FILE using C under unix.  
jpd


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-15-07 06:21 PM

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.





[ Post a follow-up to this message ]



    Re: Insert Hex '0A' into a DAT FILE using C under unix.  
Dave Hinz


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-15-07 06: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?






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:07 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register