Hello,
I have a file.txt with 20000 lines and 2 columns each which consists of current_filename and new_filename . I want to create a script to find files in a directory with current_filename and move it to new folder with new_filename.
Could you please help me how to do that??
Thanks in advance,
You can try something like that :
current_folder=. new_folder=./archive while read current_filename new_filename do current="${current_folder}/${current_filename}" new="${new_folder}/${new_filename}" [ -f "${current}" ] && mv "${current}" "${new}" done <file.txt
Jean-Pierre.
Thanks Jean.