Use sed to append text to filenames if text not already present

view story

http://www.unix.com – I have some html with hrefs that contain local links to pdf filenames. These filenames should have standardised names, i.e. there should be a label prior to the ".pdf" filename suffix. There can be many of these links on a single line of text and some may already have the label. For example Code: href="dir/blaba.pdf"... href="dir/blabla label.pdf" ... href="dir/dingdangdong.pdf" I want the result to end up as Code: href="dir/blaba label.pdf"... href="dir/blabla label.pdf" ... href="dir/dingdangdong label.pdf" (HowTos)