Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a need to compare the file name of the list of file and copy the last file in other directory
For exemple:
dir : nameDir
files: A1_scope_20180818.csv
A1_scope_20180820.csv
A2_scope_20180818.csv
A3_scope_20180819.csv
A4_scope_20180821.csv
A4_scope_20180818.csv
So, i want to copy these files ( A1_scope_20180820.csv,A2_scope_20180818.csv, A3_scope_20180819.csv,A4_scope_20180821.csv
) in the other dirctory.
At the moment, i got the index, name and the date of each file. It means:
1, A1 , 20180818
2, A1, 20180820
3, A2, 20180818
4, A3, 20180819
5, A4,20180821
6, A4,20180818
tFileList --> tFixedFlowInput --> tMap -> tJavaRow --> tLogRow.
Now i want to comapre the name and date of one file with each other file to take the file of recent date.
any suggestions on how to do this?
thanks a lot,
ledoan
Hello TRF,
i don't understand your reponse, can you explain more detailled please.
i want store these informations (index, name and date) of each file in the ArrayList and browse the list with its index to compare the file name.
i think to use ArrayList<HashMap<String, Date>> to store the values of variables name and date. But when i declare this ArrayList, it appears the errors (HashMap cannot be resolved to type).
java.util.ArrayList<HashMap<String, Date>> test = new java.util.ArrayList<HashMap<String, Date>>();
Have you an idea for this.
Thanks
Br
Giang
Hello,
i need to store all filename and also the date of this filename because i want to remove duplicate files and keep only the files that have the newest date.
For ex: i have the list of file in the folder 1 (6 files)
A1_scope_20180818.csv
A1_scope_20180820.csv
A2_scope_20180818.csv
A3_scope_20180819.csv
A4_scope_20180821.csv
A4_scope_20180818.csv
After the traitement, i want to obtain the list of file in the folder 2 (4 files)
A1_scope_20180820.csv, A2_scope_20180818.csv, A3_scope_20180819.csv, A4_scope_20180821.csv.
if i store only the max date in global variable, i can obtain only 1 file A4_scope_20180821.csv( file has the max date in its name file)
Giang
Thanks so much for your help.
Hi can you please provide the zip file of your working job?