473,386 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

append to file and delete from file

sokoun
30
Hi all,

I want to append a word or phrases to file without replce the old data in the file. could you give a sample program for me?

another one, i want to delete a spacific work or phrases in the file, how to write this program? with a sample one.

thanks.
Sep 10 '07 #1
2 1224
Atli
5,058 Expert 4TB
Hi.

You can use the fopen() function with "a" as a second parameter to append to the end of a file.

To delete from the file it would probably be best to read it into a variable and use some of the string functions to edit it.
Unless it is a huge file, in which case you would probably need to read it in portions and overwrite it as you go.
Sep 10 '07 #2
pbmods
5,821 Expert 4TB
Heya, Sokoun.

If you are reading and writing large amounts of data to this file, you might want to consider using a database as a more robust solution.
Sep 10 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: JMCN | last post by:
hi- i have inherited an access 97 database that keeps track of the loans. i have been running into referential intergrity problems when i try to append new loans to table. first of all is a...
5
by: Wayne Wengert | last post by:
I am using VB ASP.NET. In my page I convert an uploaded XML file to a dataset as follows: Dim ds1 As DataSet = New DataSet ds1.ReadXml(strPathName, XmlReadMode.Auto) Now I want to append...
3
by: Cc | last post by:
how do i delete last append line?
4
by: MN | last post by:
I have to import a tab-delimited text file daily into Access through a macro. All of the data needs to be added to an existing table. Some of the data already exists but may be updated by the...
1
by: kamle_b | last post by:
I know it is best said to archive records when you press delete button. I need help with this. I have a list box where filtered data is showed. The user highlights the record and clicks on delete...
16
by: Hans Fredrik Nordhaug | last post by:
I'm trying to write to a file in the current directory - no remote files. The subject says it all - I can add that both the directory and the file is wordwritable. This happens on a (quite good)...
10
by: pythonnoob | last post by:
Hello everyone. New to python as well as this forum, but i must say ive learned a but already reading through some posts. Seems to be a pretty helpful community here. Before i post a question...
4
by: Scott12345 | last post by:
Hi, here is my situation, I have a DB that tracks machine downtime (30 machines) per day. Several users will update this through the day. I created an append query that creates 30 dummy values and...
8
jinalpatel
by: jinalpatel | last post by:
I have two tables. tblClass and tblWithdrawn. On my main form(bound to tblClass) I have several data entry fields like Date withdrawn, Status (active or withdrawn) Date Classified etc. Also...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.