Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ Visual-Studio , +
I need help.
I have a txt file. which is an inventory of a store. The format of each is aritgo by name, location in the warehouse and date separated by ";". Example: Computer; 001; 10/02/2013
One aim of my work is to select an item and remove. How can I do?
Posted 14-May-13 4:21am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

There is no direct way for removing a line from a file. However you might read the input file line by line, copying to a new file only the lines you want to maintain. At the end of the process discard the original file and rename the freshly written one.
  Permalink  
Comments
andremateus at 14-May-13 9:25am
   
Can you say me a code?
andremateus at 14-May-13 9:26am
   
I'm beginner and this is a work to university.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 304
1 Maciej Los 285
2 Sergey Alexandrovich Kryukov 230
3 Shweta N Mishra 186
4 Aajmot Sk 153
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,760


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 14 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100