473,657 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extract/Include bites in binary file

Hi.

How I can Include or Extract bites in a binary file??
I'm tring to use a fopen method, but without success.

Do you have any idea???

Thanks!!!

Oct 7 '05 #1
5 1797
The better way to say: Include or Remove bytes in a binary file...
What functions I need to use, and how to implementing?

Thanks!!

Oct 7 '05 #2
Senger wrote:
How I can Include or Extract bites in a binary file??
I'm tring to use a fopen method, but without success.

Do you have any idea???


Your question is addressed in the FAQ 5.8. Please take a read.

V
Oct 7 '05 #3
Senger wrote:

The better way to say: Include or Remove bytes in a binary file...
What functions I need to use, and how to implementing?

Thanks!!


open the file for reading
open a second file for writing

while( ...
read from the first file
decide if you need some modifications on what you read
write the new content to the file
}

close both files
delete the first file
rename the second file to have the name of the first file

done!
--
Karl Heinz Buchegger
kb******@gascad .at
Oct 7 '05 #4
Senger wrote:
The better way to say: Include or Remove bytes in a binary file...
What functions I need to use, and how to implementing?


'fopen', 'fread', 'fwrite', 'fclose'. As to how, read the books.
They explain it all much better than anybody can in a newsgroup post.
Oct 7 '05 #5
Thanks for all.

I''ll try to do!!!

Oct 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2057
by: Logical | last post by:
I wanted to do: include('page.htm?id=12&foo=bar'); But since I can't (and don't want to make another seperate HTTP request with include('http://...')); I was wondering if there's a function similar to extract(); that can handle a query string as input, so that I could: $id = 12; $foo = 'bar'; include('page.htm');
7
6851
by: flamesrock | last post by:
Hi, As a newbie to the language, I have no idea where to start..please bare with me.. The simcity 4 savegame file has a png image stored at the hex location 0x80. What I want to extract it and create a file with the .png extension in that directory. Can somebody explain with a snippet of code how I would accomplish
7
3596
by: William Payne | last post by:
Hello, I have a variable of type unsigned long. It has a number of bits set (with set I mean they equal one). I need to determine those bits and their position and create new numbers from them. For example, consider this four-bit number: 1100 from this number I want to extract two numbers: 1000 and 100 had the four-bit number been 0101 I would want to extract 100 and 1. How should I do this? I wish I had some code to post but I don't...
7
911
by: SunRise | last post by:
Hi I am creating a C Program , to extract only-Printable-characters from a file ( any type of file) and display them. OS: Windows-XP Ple help me to fix the Errors & Warnings and explain how to use Command-Line Arguments inside C program.
8
6050
by: nick | last post by:
Hi all can any one please tell me what is wrong in this code?? I'm new to deal with text files and extract data. i'm trying to look for data in a text file (3~4 pages) some lines start with a word "red" first if find(red) then print the last 5 letters of that string and if red is not found at the begining of the string then do nothing and go to another line. how can I also do this using find( )??
1
5322
by: Chris | last post by:
If this is not the right place to post, please someone direct me to the correct place. I'm having problems extracting the binary data that's included in an xml response back from a server. It's an embedded PDF file that's been base64 encoded. I've got it narrowed down to to a single node using Msxml2.DOMDocument.4.0 and selectSingleNode but how do I get the data from there to a PDF file and get the browser to display it. Can someone...
2
3089
by: Fabian Braennstroem | last post by:
Hi, I would like to delete a region on a log file which has this kind of structure: #------flutest------------------------------------------------------------ 498 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04 8.3956e-04 3.8560e-03 4.8384e-02 11:40:01 499 499 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04
7
2106
by: JoeC | last post by:
I am trying to create a windows program that reads binary graphics as a resource. This has nothing to do with win32 but conversion of data with memcpy. graphic::graphic(UINT uiResID, HINSTANCE hinstance){ size = 32; bitData.clear(); void * p = NULL; // point to the data int end; BYTE data;
6
3686
by: BlackLibrary | last post by:
The title probably tells it all. I'm a VB6 going to C# and trying to take a task I can do easily in VB6 and do it in C#.NET. I can really use some help and any pointers you can share. Below is the code I've created so far to the job. Attached is the binary file in question so you can proof it for yourself. Form has a multline textbox and a button event. private void button1_Click(object sender, EventArgs e) {
0
8395
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4306
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.