Yes, after JDK 1.4. It's very convenient. Much easier than to read
Excel files. Especially I only need 1 column most of the time.
Thanks a lot.
Wayne
> easy if you use split()
>
[quoted text clipped - 19 lines]
> >
> > Thanks a lot?
I have released the Open Source FormattedDataSet API. It has a couple
utility methods that will help you get the sorting done (Utils and
Array
Here is the code:
// convert request parms to an array
String[][] params=Utils.getParameters(request);
// sort by column 2 (arrays start at 0) in ascending order. after
this call the array is sorted
ArrayComparator.sort(params, 1, "asc");
The array is now sorted. If you want to sort by more than 1 column
you can do the following
ArrayComparator ac=new ArrayComparator();
ac.addSortCol(1,"desc");
ac.addSortCol(3,"asc");
ac.sort(myArray);
// the array will be sorted. this is similar to a SQL order by
clause.
// i.e. when array indexing is accounted for it is similar to 'order
by col2 desc, col4 asc'
The FormattedDataSet does much more than this. It is the easiest way
I have seen to generate dynamic text including html and xml.
Visit http://www.fdsapi.com to see a live demo that converts request
params into various outuputs (including html, csv, and xml), and to
see the java docs for the ArrayComparator.
steve - http://www.fdsapi.com, http://www.jamonapi.com