Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2012
    Posts
    1
    Rep Power
    0

    Default Java text file editor

    Hello, I'm kind of new to java, have been programming a little before. Now the thing is, i need to make a program that will edit a .yml file, for example:

    (user)Roger:
    Password:pass123
    Email:example@email.com

    Now, i need a program that will delete Rogers data every time you start it. Rogers field wont be in any specific line or so, but i'd appreciate all help i could get. I'm making this little program for myself, so i have all the time i could get. If you know how to make it, then please reply, cause this is kind of important to me. I dont know, maybe it would be easier if my program copies the .yml file and deleting rogers field, and replacing the old file with the new one. This all is just something ive thought about, how to make it easier. I've seen lots of people that have a solution for it, but i dont really get all the system.out.writeln or whatever, cause, as i said, im new to Java. Once again, i appreciate all help i can ever get :)

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,518
    Rep Power
    25

    Default Re: Java text file editor

    Look at classes that will read and write text data. Read in the file line by line, saving them in an arraylist, removing the lines you don't want saved. When you have read all the lines and saved the right ones, close the file and then open it again to write on it. Copy the contents of the array list to the file.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. text editor problem
    By danielparry in forum New To Java
    Replies: 3
    Last Post: 03-04-2011, 03:26 PM
  2. text editor does not open file
    By globo in forum Advanced Java
    Replies: 2
    Last Post: 11-21-2010, 07:39 PM
  3. Help for a Text Editor.
    By necroninja in forum Advanced Java
    Replies: 0
    Last Post: 08-01-2009, 05:21 PM
  4. SWT Text Editor
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-07-2008, 04:43 PM
  5. Problem in Text Editor
    By mustahsan4u in forum New To Java
    Replies: 2
    Last Post: 03-26-2008, 02:34 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
  •