First, the easy part. To read this data, you'd want something like this:
<code><pre> BufferedReader reader = new BufferedReader(new FileReader(file));
String line;
while ((line = reader.readLine()) != null) {
StringTokenizer columns = new StringTokenizer(line, ",");
String column1 = columns.next().trim();
String column2 = columns.next().trim();
...
}
</pre></code>
You'll need to put in some sort of exception handling. And if you can ever have a blank field represented by two adjacent delimiters (",,"), you'll need to write your own version of StringTokenizer to return a blank String "". But anyway...
For the collection, it realy depends how the data will be used. Do the columns make sense on their own, or do they only make sense when used in conjunction with other data on the same row? Probably the latter - so I'd be inclined to have a single collection of Record objects, where Record is a class you write which stores all the data on one row. Does the order of the records matter? If so, you probably want a List. Do you want to be able to find a record quickly using a unique key (e.g. bBILL_NO or RECEIPT_NO)? Then use a Map. Should the rows be sorted by some criterion? Then use a SortedList or SortedMap. As you can see, the decision of what collection class to use is based on how you want to use the class. If you're not sure, try just using an ArrayList for starters. Try to refer to it as a Collection rather than an ArrayList whenever possible though, so that if you find the need to change the type later, it will be easier.