Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Append COB date in file name

Azadare MMar 15 2016 — edited Mar 15 2016

Hi All,

I need to create shell script in which I need to change existing file name to another name:

suppose I have file say test_file.csv at /XXXX/XXX/XX/test_file.csv

now I want rename that test_file.csv to with another name and the logic of renaming file is like below:

suppose sysdate is 03 march 2016 i.e day is Monday then file name should be like test_file_yyyymmdd.csv but here the catch is if day is Monday then it should pick last Friday's date, so in our example new file name should be test_file_20160311.csv

if day is tue then Monday's date like test_file_20160314.csv

up to Friday, if day is Friday then Thursday's date.

thanks

This post has been answered by Dude! on Mar 15 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 12 2016
Added on Mar 15 2016
1 comment
771 views