Replacing a damaged plug is easy, but for safety you have to follow proper wiring rules, especially when wiring a polarized plug.
Follow the rules of polarity for a safe fix.
Lamp Hack: How to Make Any Lamp Cordless - * View Along the Way *
How to Fix a Lamp Cord (DIY)
Five minute fix for a broken lamp, Thrifty Decor Chick
How to Fix a Lamp Cord (DIY)
From Plug-In to Hardwire - How To Convert a Plug-in Light to a
Five minute fix for a broken lamp, Thrifty Decor Chick
rewiring an old lamp. – Reading My Tea Leaves – Slow, simple
DIY Lamp Wiring Kit (Antique Brass Socket & Brown Cord) - Makely
How to Make Your Own Color Cord Light Fixture
How to Wire a Lamp (with pictures) - Scavenger Chic
How to Hide Pesky Lamp Cords - Hi Sugarplum!
1.8Meter Lamp Cord with Switch Plug Extension Cords Wiring
How to add an inline lamp cord switch
How To Replace A Lamp Cord Switch Quickly And Easily