I believe there is a simpler way for this case: the lexicographic order of file names correspond to correct sequence of dates TRMM_1998_01_0100_newntcl.csv TRMM_1998_01_0103_newntcl.csv TRMM_1998_01_0106_newntcl.csv, TRMM_1998_01_0109_newntcl.csv ... TRMM_1998_02_1512_newntcl.csv. You may try to issue smth like this to get the file list in correct order dir /B > file_list.txt under Windows or ls ?? (google for params) > ./file_list.txt in Linux
netcdfgroup
archives: