Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rename a fileparsing fie name from a diferent file

Status
Not open for further replies.

pahad

Programmer
Oct 29, 2003
3
US
I have a file with the following format
1000 customers
2000 advisors
3000 visitors


the first column is actual list of files located in one directory. I have to parse the above file and change the file name to the corresponding name in second column.
something like /var/tmp/1000 /var/tmp/customers

I appreciate your help.

pahad
 
works with sh (and bash)

export FROM_D="/var/tmp/"
export TO_D="/var/tmp/"
cat inputfile | while read FROM TO
do
mv ${FROM_D}/${FROM} ${TO_D}/${TO}
done
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top