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
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.