473,396 Members | 1,789 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,396 software developers and data experts.

delete data in file

Hi,

let say I have test.dat with following entry:

***********
string1 string2
string3
***********
string4 string5
string6
***********
string7 string8
string9

I would like to delete the first entry (when find the first ***********),
which is:
***********
string1 string2
string3

so that the test.dat will only have:
***********
string4 string5
string6
***********
string7 string8
string9

I don't want to use the solution of copying to a temp buffer/ temp file,
then rewrite the test.dat.
If you have other better solution, let me know. If manipulate directly with
test.dat, will be the best.

Thanks.
Nov 14 '05 #1
1 4117
On Mon, 5 Jul 2004, Magix wrote:

M>Hi,
M>
M>let say I have test.dat with following entry:
M>
M>***********
M>string1 string2
M>string3
M>***********
M>string4 string5
M>string6
M>***********
M>string7 string8
M>string9
M>
M>I would like to delete the first entry (when find the first ***********),
M>which is:
M>***********
M>string1 string2
M>string3
M>
M>so that the test.dat will only have:
M>***********
M>string4 string5
M>string6
M>***********
M>string7 string8
M>string9
M>
M>I don't want to use the solution of copying to a temp buffer/ temp file,
M>then rewrite the test.dat.
M>If you have other better solution, let me know. If manipulate directly with
M>test.dat, will be the best.

With only standard-C available the only way is to rewrite the file.

harti
Nov 14 '05 #2

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

Similar topics

2
by: Oliver Peek | last post by:
Hi all, Probably my fault, I'm opening a Berkeley DB file, iterating through and deleting keys, well making an attempt. I get this error when I try to delete. ---error Traceback (most...
2
by: andy | last post by:
I am having an issue with the way SQL server deletes data. I am trying to delete data from the DB and have it completetly gone. Here is what I did 1. added a table with a row of image data...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
2
by: Hervé Piedvache | last post by:
Hi, A small question ... and your opinions are well done ... I have tested one thing today ... I have a script in charge to insert a lot of files inside one of my db. I have a perl script...
3
by: vcornjamb | last post by:
Hello, I am developing a web form that contains some buttons and a data grid which has as its last column link buttons that will delete the data associated with that row. Everything works fine,...
8
by: DavidB | last post by:
I'm trying to delete a file with File.Delete("c:\Documents and Settings\%username%\Application Data\Microsoft\Excel\excel*.xlb") On doing this I get an Exception "Illegal characters in path" -...
0
by: teddymeu | last post by:
Hi Guys, since I've done nothing but ask questions these last few weeks to get my first application up and running I thought it was about time to share the wealth and help out a newbie like me since...
6
by: satish mullapudi | last post by:
Hi All, I am getting strange situation. These r the steps I have followed: 1. Created an EMPLOYEE table with around 14 fields & 688038 records. (so a large table indeed). 2. Tried to delete all...
7
by: ITAutobot25 | last post by:
My delete button is not working in my GUI and my due date is today before midnight. Can anyone show me how to correct this error? My assignment statement is below as well as 5 classes. InventoryGUI...
3
by: stonefunker | last post by:
I've been playing around with the concept of wiping files from a thumbdrive and it seems to be working pretty well. I have the code below and the file seems to be overwritten as they should. I...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.