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

  • Home
  • SEARCH
  • 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 4010196
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:58:12+00:00 2026-05-20T08:58:12+00:00

I want to remove some information from a text file without shifting its all

  • 0

I want to remove some information from a text file without shifting its all records. For example a text file customers.txt is given. it have a lot of records seperated by # delimiter. and each record contains fields separated by ;. Like this: 1665;John;Smith given a customer id, I want to remove a customer with corresponding id. I can find offset and length of the record in the file, but don’t know how to remove it. do i have to re-write whole file?

Note: I’m using Standard C++ with g++4.5 and libst4.

  • 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-20T08:58:13+00:00Added an answer on May 20, 2026 at 8:58 am

    You have a couple of choices.
    1) rewrite the remainder of the file past the record you are removing.
    2) replace the record with some indicator that it is removed and handle that in your parsing of the file (like replacing the entry being removed with # or some other special character).

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

Sidebar

Related Questions

I want to remove some elements from a vector and am using remove_if algorithm
I want to during the page render remove some html from the page (don't
I want to use the Oracle REGEXP_REPLACE to remove some dots from a String.
I have some text that has HTML hyper-links in it. I want to remove
I am trying to do some string cleanup. I want to remove all the
Today I am trying to remove some bytes from an EXE file. Inside the
I have a JTable with some information in it. Now I want remove a
I want to remove some of the dashboard menu tabs on my wordpress site
I have this matrix of size 10000 by 1. I want to remove some
Strange situation: I am trying to remove some hard coding from my code. There

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.