Click here to Skip to main content
13,049,233 members (63,778 online)
Rate this:
Please Sign up or sign in to vote.
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
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.
andremateus 14-May-13 9:25am
Can you say me a code?
andremateus 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 14 May 2013
Copyright © CodeProject, 1999-2017
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