mercredi 31 décembre 2014

From Mysql query output to retrieve files in the file system and rename the files


I have to call a SQL query from bash that outputs 1000 rows of two columns i) File_Path (Eg., /opt/files/dest/2.bin ii) Name_of_the_file(Eg., fax attachment.pdf, invoice.docx yes there are spaces). The file name in the server file system is in different naming format eg: 1.bin, 22.bin. There are <1000 unique files exactly as some are missing.


As a first step, I gathered all those files and put it in a temporary folder.


But I couldn't able to rename the files as I have to lookup the 'Name of the file' with corresponding 'File Path'. Is there any way I can perform the job?



Aucun commentaire:

Enregistrer un commentaire