Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
1.00/5 (1 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

1 solution

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.
 
Share this answer
 
Comments
[no name] 14-May-13 9:25am    
Can you say me a code?
[no name] 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900