aspose file tools
The moose likes Java in General and the fly likes How to manage a text file is a List or something similar. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "How to manage a text file is a List or something similar." Watch "How to manage a text file is a List or something similar." New topic
Author

How to manage a text file is a List or something similar.

Paul Duer
Ranch Hand

Joined: Oct 10, 2002
Posts: 98
Hi guys,

I have 2 text files, each is in the standard Key=Value style. I would like to be able to quickly read those files into a List object of some sort, and then be able to add pairs to the end of the file and maybe if I get more advanced, change values in the pairs.

I think this is real simple thing, I just can't think of what package might make this eaisest.

I also have an XML file to manage, basically adding and editing elements quickly and programmatically.
Rachel Swailes
Ranch Hand

Joined: May 18, 2004
Posts: 434
For the standard key=value, have a look at Properties Files.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24041
    
  13

Rachel is correctly pointing you to the java.util.Properties class.


[Jess in Action][AskingGoodQuestions]
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
For XML files, you have to look at third-party implementations of DOM. Apache's Xerces is a popular DOM implementation.

HTH

Layne


Java API Documentation
The Java Tutorial
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to manage a text file is a List or something similar.
 
Similar Threads
UBB protocol
Property File Naming
upload file + other form input values
tool for creating property-resource-files (internationalization)
More Music - Any ideas?