string replace in huge file

I need to parse a huge file... with some strings like this:

<li class="website-feature"><a href="http://some.changingurl.com" ..(some changing classes)..>

I need to change the above to:

<li class="website-feature">http://some.changingurl.com<a href="http://some.changingurl.com" ..(some changing classes)..>

Then later on I can remove all html tags but keep the url saved. Only the url is changing.

Please help me write a subsititution.

Thank you.

---------- Post updated at 07:25 PM ---------- Previous update was at 05:14 PM ----------

anybody help?

Have a go with this. It works for me on the limited example you provided, but it might over match with other lines. It only replaces the first one on each line; if there are multiple sets that need to be replaced it will need at least a small tweak if not more effort.

sed -r 's/<a href="([^["]*)"/\1&/' input-file >new-file

If you are using sed on a BSD machine, or using the sed which is a part of the AT&T AST tools, then use -E instead of -r.

Thanks a lot. I am testing it.

---------- Post updated 07-17-12 at 02:38 PM ---------- Previous update was 07-16-12 at 09:30 PM ----------

it works! ty