Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Copying a files contents

Posted on 1999-06-24
11
Medium Priority
?
166 Views
Last Modified: 2010-04-15
I need to delete a row from a file with many rows in it.  Does anyone have any suggestions as to THE MOST EFFICIENT/FASTEST algorithm KNOWN TO MANKIND on how to do this?  I have some ideas, such as simply string copying from one file to the other and omitting the row that I dont want...but I dont know if that's THE FASTEST in the entire UNIVERSE.  You know, they should make a search engine on this experts-exchange forum, I'm sure this question has been asked before, but I'm way too lazy to go through 2000 paq to  perhaps find the one I need.  Thanks to all.
0
Comment
Question by:mrquija
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 7

Expert Comment

by:KangaRoo
ID: 1262928
42
Ask Mirkwood.
0
 
LVL 1

Author Comment

by:mrquija
ID: 1262929
not sure what you mean by your comment of Asking mirkwood.
0
 
LVL 1

Author Comment

by:mrquija
ID: 1262930
by the way, I'm not asking for code...merely just suggestions/practical ideas for fastest completion of this task.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Expert Comment

by:KangaRoo
ID: 1262931
0
 
LVL 7

Expert Comment

by:KangaRoo
ID: 1262932
I can't tell you about the fastest method in the Universe. What you sketched seems ok.
You could add some info at the beginning of a record, like wether the record is in use or free (deleted) and the size of the record (not needed for fixed lenght). Once in a while you clean up the file by copying only used records into a new file.
0
 
LVL 11

Expert Comment

by:alexo
ID: 1262933
Use memory mapped files
0
 
LVL 6

Expert Comment

by:Triskelion
ID: 1262934
Since you're not asking for code...
Yes, copy line by line -- omiting the line you don't want.

Another techniqe would be to mark the first character with an ID you know means "don't use this line" -- such as changing
This is neat
   to
£his is neat
0
 
LVL 7

Expert Comment

by:KangaRoo
ID: 1262935
That was put in as comment Triskelion.
0
 
LVL 1

Expert Comment

by:Aggarwal
ID: 1262936

actually that depands on ur file structure !!! if its a sequential file then this is the approach .. in case u are the creator of the file .. then u can make this even faster ..

how about storing Linked List in a file with the pointer as file offset ..

regards
0
 
LVL 1

Author Comment

by:mrquija
ID: 1262937
Kangaroo gets points
0
 
LVL 7

Accepted Solution

by:
KangaRoo earned 90 total points
ID: 1262938
Not much left to say.Thanx
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question