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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find and replace in a bunch of files 2

Status
Not open for further replies.
hmmm.. 1st, you should find all files with the .wmv extention:

[tt]grep -r ".wmv" /path/to/html/*[/tt]

with all files you should use sed or awk in order modify the content.

 
Try something like this:
perl -i.bak -p -e 's#/([^/]+).wmv#/$1/$1.wmv#g' $( grep -l wmv * )

I'd check on the regular expression first, perl is not my language of choice.
 
thanks ericbrunson ,
perl -i.bak -p -e 's#/([^/]+).wmv#/mov/$1.wmv#g' $( grep -l wmv * )
did the trick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top