Page 1 of 1

filepattern read, need to split on date , and process loop

Posted: Thu Feb 14, 2013 4:01 pm
by smohd1338
I have six files , i am reading in file pattern manner, files will ahve this names BLG_LB_010213.txt,BLG__SA_010213.txt,BLG__AD_010213.txt, but for some reason if my etl process doest run, there will be 6 files now , 3 with previous day, and 3 new from current date,BLG_LB_010313.txt,BLG__SA_010313.txt,BLG__AD_010313.txt , how do i split them based on date and seklect only the 3 files with same date and run and loop again?

Posted: Thu Feb 14, 2013 4:07 pm
by ray.wurlod
How are you reading them now?

Assuming it's an ls command, just add to that - maybe sort in date/time order and pipe the result through tail -3 command.

Posted: Thu Feb 14, 2013 4:27 pm
by smohd1338
I am reading thropugh LS command now,

tahnsk, they can be sorted on date, i missed taht :)