Pure Programmer
Blue Matrix


Cluster Map

Project: Reorder Columns

Write a program that reorders tab-delimited input provided on stdin. It should take commandline arguments that specify the columns to print. The order of the arguments determine the order that the columns are printed. The columns are numbered from one to the number of columns in the data.

Output
$ javac -Xlint ReorderColumns.java $ java -ea ReorderColumns 1 5 < ../../data/text/AmortizationData.txt Month Balance 0 5000.00 1 4592.79 2 4183.89 3 3773.28 4 3360.96 5 2946.92 6 2531.16 7 2113.67 8 1694.44 9 1273.46 10 850.73 11 426.23 12 0.00

Solution