How to delete a particular line from a file?

Let’s learn how to delete a particular line from a file. The most accurate or helpful solution is served by Stack Overflow.

There are ten answers to this question.

Best solution

how to delete first line in a txt file

i am new in c#. I want to delete the first line in the txt file .

Answer:

Basically you need to copy it to another file - you can't remove (or insert) data in a file "in...

Read more

Arshiya Gm at Stack Overflow Mark as irrelevant Undo

Other solutions

Answer:

perl -lni -e'print unless /stuff in line I want to delete/' file.txt

Read more

shanky1987 at Amazon Askville Mark as irrelevant Undo

Java delete line from text file?

Hi Friends, I am writing a java program, which is writting to a text file in this form: aaa : bbb : ccc :ddd eee : ggg : ggg: hhh kkk : ppp : qqq: ccc now i want to delete middle line with eee: ggg : ggg: hhh and move the last line to move one step up...

Answer:

How about this public static void copyAndRemoveLine(Reader _in, Writer _out, int line) { try { BufferedReader...

Read more

john at Yahoo! Answers Mark as irrelevant Undo

Answer:

Hard to answer - you don't say where the duplicated line might be.

Read more

community wiki at wiki.answers.com Mark as irrelevant Undo

Answer:

It failed to open the file with very minimal error message, let along repairing it. Since pdftk is GPL...

Read more

Anonymous at ChaCha Mark as irrelevant Undo

Answer:

As in any other language that does not offer a more specialized solution: open the file, and a temporary...

Read more

Miguel Paraz at Quora Mark as irrelevant Undo

Answer:

colrm 1 6 < InputFile > OutputFile

Read more

Sharad Nandanwar at Quora Mark as irrelevant Undo

How to delete Temp file and Prefetch files via Batch command without deleting, and creating again Temp folder,?

i,m trying to clean temp files/ prefetch files withe Batch command, without compliantly deleting and creating again this folders. In other words go to folder select everything in it, and delete also try not to get error "can't continue this files...

Answer:

del %temp%\*.* /s /q the /s means to delete files in all of %temp%'s subdirectories also the /q means...

Read more

kademi at Yahoo! Answers Mark as irrelevant Undo

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.