Results 1 to 2 of 2
  1. #1
    Mystri67 is offline Member
    Join Date
    Apr 2012
    Rep Power

    Cool text file parser


    was wondering if there is a way to parse a text file in java? example:

    1) read in a text file (.txt, .ged, ect...)
    2) search for a specific parameter
    3) output the text file to a new file minus the parameter

    1) read in familytree.ged
    2) search and remove any line with http://......
    3) output the text to a new file familytree1.ged without the http://..... lines

    the 2 files would be the same except for the lines that have http://....... removed


  2. #2
    shall is offline Senior Member
    Join Date
    Apr 2012
    Rep Power

    Default Re: text file parser

    I think the Scanner class should do you want: Scanner (Java Platform SE 6).

    see the following methods:
    String next(Pattern pattern)
    String next(String pattern)

    Take a look at the examples in that same link.

Similar Threads

  1. Replies: 1
    Last Post: 06-28-2011, 02:54 PM
  2. Looking for a Text Parser
    By breitbc in forum New To Java
    Replies: 7
    Last Post: 05-10-2011, 06:46 PM
  3. Custom Text Parser
    By magnum99 in forum New To Java
    Replies: 4
    Last Post: 07-11-2009, 12:15 AM
  4. Replies: 0
    Last Post: 07-07-2009, 06:22 AM
  5. [SOLVED] Text Parser
    By karthik7974 in forum New To Java
    Replies: 20
    Last Post: 04-22-2008, 10:18 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