Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 08-12-2007, 06:31 AM   #1
LQ Newbie
Registered: Aug 2007
Posts: 2

Rep: Reputation: 0
Smile rename files from list1 to list2

I made the list of files in a folder and edited it manually. Now I want to rename original files to names in that second list. The number of the names in both lists is the same, they are also on the same position, some of them are altered, that is the only difference.
Thank you very much!
Old 08-12-2007, 11:06 AM   #2
Registered: Mar 2007
Location: Plymouth, UK
Distribution: Fedora Core, RHEL, Arch
Posts: 342

Rep: Reputation: 38
I am not aware of anything that can do that out of the box, but this can be done quite easily with scripting, like php, perl, and the like
Old 08-12-2007, 11:41 AM   #3
LQ Newbie
Registered: Aug 2007
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for your efforts, i have already found it and will paste the code in case someone else needs it:

exec 3<textfile1
exec 4<textfile2
cd /path/to/directory/with/images
while read file <&3; read name <&4
mv "$file" "$name"

it works for me.
Have a nice day!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to rename files using sed? seimour Linux - Newbie 1 05-02-2007 01:46 AM
rename files linux2man Linux - General 8 02-03-2007 05:26 AM
How to rename multiple files? Rostfrei Linux - Newbie 3 07-11-2006 06:06 AM
rename files allelopath Linux - General 5 07-05-2005 03:00 AM
Can not rename files. Maximus2000 Linux - General 0 04-22-2004 01:36 PM

All times are GMT -5. The time now is 12:28 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration