Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1057103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:48:54+00:00 2026-05-16T17:48:54+00:00

i am using a text file to store my data records. the data is

  • 0

i am using a text file to store my data records. the data is stored in the following format.

Antony|9876543210
Azar|9753186420
Branda|1234567890
David|1357924680
John|6767676767

Thousands of records are stored in that file. i want to delete a particular record, say “David|1357924680”. I am using C, how to delete the particular record efficiently? currently i am using a temporary file to copy the records to that temp file by omitting the record i want to delete. and after copying to temp file, i copy the contents of the temp file to original file by truncating all the contents of the original file. i don’t think that i am doing it efficiently. Help me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:48:55+00:00Added an answer on May 16, 2026 at 5:48 pm

    Add a column to your data indicating it is either a valid ( 1 ) or deleted ( 0 ) row:

    Antony|9876543210|1
    Azar|9753186420|1
    Branda|1234567890|1
    David|1357924680|1
    John|6767676767|1
    

    When you want to delete a record, overwrite the single byte:

    Antony|9876543210|1
    Azar|9753186420|1
    Branda|1234567890|0
    David|1357924680|1
    John|6767676767|1
    

    Branda is now deleted.

    Then add a data file compression function which can be used to rewrite the file excluding deleted rows. This could be done during times of low or no usage so it doesn’t interfere with regular operations.

    Edit

    The validity column should probably be the first column so you can skip deleted rows more easily.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want store data from an html page to a text file using javascript
I'm writing to a text file using the following declaration: void create_out_file(char file_name[],long double
I want to write JSON data to a text file using jQuery and PHP.
I have to write a biginteger into a text file using the following statement.
I am using the following tcl code to store a file from my deskstop
I am using the following program to update the data which is stored in
I am storing some JSON data in a text file to query using jQuery
Hi i created one sample application that saves data as text file using simple
In my Android app I should store the data from user in simple text-file,
Need to store dataset data into the text file with column Separator / and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.