Tuesday, December 23, 2014

command line - Move files with the same name but different extension to existing location containing files with same name

I currently have a parent directory with 10 folders with 10 different dates for names (ie. 2016-11-21, etc.) In these date folders, are WAV files with unique file names.


Separately, I have corresponding TXT files with the same name, but they are not currently in the folders with the matching WAV files. How can I loop it such that if the filenames match, the TXT file gets moved to the existing folder location within the parent directory?


Currently I have this structure:


/Folder1/File1.TXT
/Folder1/2011-11-21/File1.WAV

I want something such that the structure will become:


/Folder1/2011-11-21/File1.TXT
/Folder1/2011-11-21/File1.WAV

Is this possible? Thanks

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...