This article demonstrates using a fixed field width | delimited text file similar to a spread sheet. You can store and retrieve various data types in give row,col cells. It expands columns if new data is longer than the cell. It does not add new columns or rows however and if you try to access columns or rows that are no there you get out of bounds errors. In the example I show a survey note book sheet that we use in mapping caves. A future version of this might calculate variables that would be used in cave mapping and add them to the sheet. This could also be used for mapping things above ground.
I show you how to read and write your own property file which contains name=value pairs. Java comes with a Properties object to do this exact thing and I will write an article about that object later. Or expand this article to include an example. This article is another example of using a delimiter and in this case it is = symbol. Later I will upgrade this to include new line as delimiter to handle long strings.
Here I show you how to read and write | delimited files. Each column is a field in a record. If you are writing simple applications or prototyping why use a full database? This can work just as well. I show you how to convert data types to strings and strings back to basic datatypes.
Simple examples for writing and reading to and from a text file line by line. Write, Read and Append. In Java we not only use FileWriter and FileReader but also BufferedWriter and BufferedReader to speed up reading and writing in just about all cases.