Nov 7, 2013 at 6:09am UTC
how do i sort records by user specied field in ascending order, without knowing how many columns the file has? its getting the data from a file.
Nov 7, 2013 at 6:13am UTC
What separates each column? Can some fields be blank or contain the separator?
Nov 7, 2013 at 4:12pm UTC
It doesn't matter how many columns a line/string has, only which column has the user field.
You will have to look at the data file and find the pattern.
Nov 7, 2013 at 5:14pm UTC
@LB the columns are separated by tabs @samuelAdams there are more than two data files and each has different number of columns and the user can choose to sort by any column.
Nov 7, 2013 at 6:17pm UTC
Use the Vector of Vector to store the data and pass to your sorted function, where you have to compare all the columns of inner vector for sorting
Nov 7, 2013 at 6:18pm UTC
I there is input of sorted column then sort on that column only
Nov 26, 2013 at 5:47pm UTC
thank you all for your help