Results 1 to 3 of 3
  1. #1
    ddatta8 is offline Member
    Join Date
    Dec 2008
    Posts
    27
    Rep Power
    0

    Default delete a line from a text file in Java

    Hi,
    I want to search for a particular line in a text file and then, delete it from the text file using Java. I am able to search and locate the line but I do not know how to delete it from the text file. Please help.
    Thanks.

  2. #2
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    7

    Default

    Does this help?
    [SOLVED] Delete Current line from file

    Luck,
    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

  3. #3
    ddatta8 is offline Member
    Join Date
    Dec 2008
    Posts
    27
    Rep Power
    0

    Default

    So, the only way to delete a particular line in a text file is to write the entire file except the line to be deleted to a new file? Thanks.

Similar Threads

  1. [SOLVED] Delete Current line from file
    By Azndaddy in forum New To Java
    Replies: 2
    Last Post: 04-06-2012, 08:00 AM
  2. Help! - How to insert a new line to a text file
    By matpj in forum New To Java
    Replies: 13
    Last Post: 02-24-2010, 05:28 PM
  3. Replies: 1
    Last Post: 11-10-2008, 09:49 AM
  4. Saving To A New Line Using A Text File
    By jadaleus in forum Advanced Java
    Replies: 10
    Last Post: 10-24-2008, 07:21 PM
  5. Saving To A New Line Using A Text File
    By jadaleus in forum Advanced Java
    Replies: 1
    Last Post: 10-24-2008, 12:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •