Click here to Skip to main content
11,578,739 members (63,373 online)
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 3: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 Peter Leow 135
1 Frankie-C 115
2 OriginalGriff 113
3 Richard MacCutchan 85
4 Afzaal Ahmad Zeeshan 85
0 OriginalGriff 933
1 Sergey Alexandrovich Kryukov 740
2 Abhinav S 573
3 F-ES Sitecore 420
4 Dave Kreskowiak 419


Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 14 May 2013
Copyright © CodeProject, 1999-2015
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