rename a file with that of another with same substring name
Hi,
I have some files as listed below:
sourceDirectory1:
ABC_D5.text.yr16.info.201602.txt
ABC_D5.textsample.yr16.info.201602.txt
ABC_D5.textsam.yr16.info.201602.txt
sourceDirectory2:
ABC_text.log
ABC_textsample.log
ABC_textsam.log
Requirement1: move/copy all files (*.txt) from sourceDirectory1 to targetDirectory, as is --> DONE (achieved using tFileCopy).
Requirement2: move/copy all files (*.log) from sourceDirectory2 to targetDirectory, but these log files must be renamed to corresponding ".txt" file ---> I could not achieve
Result:
targetDirectory:
ABC_D5.text.yr16.info.201602.txt
ABC_D5.textsample.yr16.info.201602.txt
ABC_D5.textsam.yr16.info.201602.txt
ABC_D5.text.yr16.info.201602.log --->(the actual file is ABC_text.log renamed to this)
ABC_D5.textsample.yr16.info.201602.log --->(the actual file is ABC_textsample.log renamed to this)
ABC_D5.textsam.yr16.info.201602.log --->(the actual file is ABC_textsam.log renamed to this)
Hope I am clear with the requirement, Please let me know if I missed any info to provide.
Thanks in advance.