Results 1 to 5 of 5

Thread: file io problem

  1. #1
    amanrv is offline Member
    Join Date
    Jul 2011
    Posts
    12
    Rep Power
    0

    Smile file io problem

    hey everyone

    i have a file with several lines. then there is a line saying "i am me". then again there are several lines what i want to do is i want to remove the line "i am me". after removing, all the lines after it have to be shifted up. what i mean is

    test
    test
    test
    test
    i am me
    test
    test
    test

    has to be replaced with

    test
    test
    test
    test
    test
    test
    test

    please help! google isnt turning up anything concrete that i can understand!

  2. #2
    Kowsi is offline Member
    Join Date
    Oct 2010
    Posts
    8
    Rep Power
    0

    Default

    Just read the file line by line (using Scanner) and check whether it is equal to "i am me"... if it is not then print it in another temporary file else proceed to next line...

  3. #3
    amanrv is offline Member
    Join Date
    Jul 2011
    Posts
    12
    Rep Power
    0

    Default

    thanks man! that never occurred to me

  4. #4
    Join Date
    Aug 2011
    Location
    Leicester/UK
    Posts
    2
    Rep Power
    0

    Default

    Follow Kowsi
    Last edited by Hamza Aldabbas; 08-20-2011 at 05:47 PM.

  5. #5
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,785
    Rep Power
    7

    Default

    Quote Originally Posted by Hamza Aldabbas View Post
    just make strcmp
    This is a Java forum not a C forum.

Similar Threads

  1. problem with JSP file
    By daisy in forum JavaServer Pages (JSP) and JSTL
    Replies: 11
    Last Post: 10-11-2011, 01:43 PM
  2. pdf file problem
    By idbirohit in forum New To Java
    Replies: 0
    Last Post: 03-03-2011, 12:12 PM
  3. Got problem with jar-file, any help?
    By Igbear in forum Advanced Java
    Replies: 7
    Last Post: 11-20-2010, 09:10 PM
  4. .BAT File problem
    By egbert95 in forum New To Java
    Replies: 8
    Last Post: 08-03-2010, 01:26 AM
  5. jar file problem
    By nishant.4545 in forum New To Java
    Replies: 1
    Last Post: 07-03-2009, 08:36 PM

Tags for this Thread

Posting Permissions

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