Results 1 to 3 of 3
  1. #1
    jayeshsugunan is offline Member
    Join Date
    Aug 2010
    Posts
    1
    Rep Power
    0

    Question how can i remove a line from an ordinary text file?

    It is easy to remove a line from a file by rewriting the file. how can i remove a line without rewriting ? Also, do not use white spaces to overwrite the line. I expect a perfect line deletion code .....

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by jayeshsugunan View Post
    It is easy to remove a line from a file by rewriting the file. how can i remove a line without rewriting ? Also, do not use white spaces to overwrite the line.
    You must understand how files are written to disk to understand that to delete a line from a text file you must overwrite the file (except for some exceptions where you say overwrite the end of a file).

    I expect a perfect line deletion code .....
    Then we expect you to produce this code. This isn't a code on demand site, and if you continue to demand code, you will be flamed and rightfully so.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,242
    Rep Power
    19

Similar Threads

  1. Remove a Blank Line from Text file
    By nitinverma in forum CLDC and MIDP
    Replies: 8
    Last Post: 06-15-2010, 06:12 AM
  2. remove variables/line in a text file
    By ddatta8 in forum New To Java
    Replies: 2
    Last Post: 01-04-2009, 03:05 AM
  3. How to remove 2 last lines in a text file?
    By Marius in forum New To Java
    Replies: 2
    Last Post: 11-30-2008, 03:54 PM
  4. [SOLVED] Remove All Line from File
    By Mir in forum New To Java
    Replies: 41
    Last Post: 07-17-2008, 09:44 AM
  5. Remove duplicate lines from a text file
    By Dirt.Diver in forum New To Java
    Replies: 15
    Last Post: 06-25-2008, 02:08 PM

Posting Permissions

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