Here are a collection of useful excerpts from web sites regarding lamp repair.
Fix a Lamp Cord
[http://www.familyhandyman.com/electrical/repair/fix-a-lamp-cord/view-all] (+ modifications)
Follow the rules of polarity for a safe fix
Replacing a damaged plug is easy, but for safety you have to follow proper wiring rules, especially when wiring a polarized plug.
A "polarized" plug has a wide blade and a narrow blade and can only be inserted one way into an outlet. Most lamps with standard sockets use polarized plugs.
The wide blade is "neutral", the narrow blade is hot.
A "non-polarized" plug has 2 narrow blades and can be inserted either way into an outlet.
A "polarized" cord has some type of marking on one of the wires.This is either a "rib" molded into the insulation or a white (or other colored) stripe.
Most often the rib or stripe indicates the "neutral" wire, but not always. Always check every connection from plug to cord to switch to socket.
Step 1:Buy a polarized replacement plug, if needed
Damaged plugs and nicked, frayed cords are a safety hazard and need to be replaced. Putting a new plug on is straightforward, but there are a few basic rules.
To prevent shocks from the metal parts of a light, lamp cords and two-wire extension cords are always polarized. This means the plug has a small blade for the hot wire and a wide blade for the neutral wire, and the wires feeding those blades should not be reversed when you put a new plug on. Always use a polarized plug for a lamp, extension cord or any other cord that’s polarized to begin with. Don’t ever use a nonpolarized replacement plug with same-size blades to replace a polarized plug. (Nonpolarized plugs are often found on double-insulated tools and some appliances.)
Step 2:Identify the neutral wire
You can identify the neutral side of the wire just by looking for markings on one of the wires. The most common identifier is ribbing in the rubber insulation all along one edge, but it can also be a white wire or a white stripe (photo below).
To identify the neutral wire look for the markings shown in the photos.
Step 3: Wire the new plug
To prepare the cut end for a new plug, cut or pull the two sides apart, then strip off about 3/4 in. of insulation.
Lamp and extension cords are usually 18 gauge, but if you’re not sure, strip the wire through the 14- or 16-gauge slot first.
If it doesn’t strip cleanly, try the next smaller gauge.
Strip the insulation off the wire by cutting and pulling the wire
through the wire stripper.
Twist the strands of wire tight, then fasten them into
the replacement plug with the neutral on the wide-blade side.
Then snap or screw the plug back together.
Replace a faulty socket
A lamp socket itself can go bad, but more often it's the switch inside the socket. Either way, the solution is replacement. A new socket is inexpensive. Regardless of the existing switch type, you can choose a push-through switch, a pull chain, a turn knob or a threeway turn knob that provides two brightness levels. You can also choose a socket without a switch and install a switched cord instead.
The old socket shell is supposed to pop out of its base with a squeeze and a tug, but you might have to pry it out with a screwdriver (Photo 1). The socket base can be stubborn too. It’s screwed onto a threaded tube that runs down through the lamp’s body. When you try to unscrew it, you might unscrew the nut at the other end of the tube instead. This will allow the parts of the lamp body to come apart, but that isn’t a big problem. Just use pliers to twist the base off the tube (Photo 2), reassemble the lamp body and screw on the new socket base to hold it all together.
When you connect the new socket, don't reuse the bare ends of the wires. Some of the tiny strands of wire are probably broken. Cut them off and strip away 1/2 in. of insulation with a wire stripper (Photo 3). Using a wire stripper is almost foolproof, as long as you choose the correct pair of notches to bite through the wire's insulation. Most wire strippers are sized for solid wire, rather than the slightly larger stranded wire used in lamp cords. You can get around this problem by using the next larger pair of notches. Since most lamp wires are 18 gauge, start with the notches labeled 16. If the stripper won't remove the insulation, use smaller notches. If the stripper removes strands of wire, cut off an inch of cord and start over using larger notches.
When you connect the wires to the new socket, the neutral wire must connect to the silver screw (Photo 4). To identify the neutral wire, start at the plug. The wider plug blade is connected to the neutral wire, and you'll find that the neutral wire is distinguished from the “hot” wire. The two wires may be different colors, there may be printing on one or the other, or there may be tiny ribs or indentations in the plastic covering the neutral wire. If your old plug blades are of equal width, replace the plug and cord along with the socket.
Photo 1: Pry out the socket
Pry the socket shell out of its base.
Cut the wires to remove the socket.
Then loosen the setscrew so you can unscrew the socket base.
Photo 2: Unscrew the socket base
Unscrew the socket base from the threaded tube.
If the base won't spin off by hand, grab the tube and the base
with pliers to spin it free.
Then screw on the new base and tighten the setscrew.
Photo 4: Connect the wires
Tie an underwriter's knot in the cord. Then connect the wires by
wrapping them clockwise around the screws and tightening.
Connect the neutral wire to the silver screw.
An underwriters knot
An underwriter's knot prevents the wires from
pulling out of the screw terminals when the cord is tugged.
How to Install a Quick-connect Plug
When replacing a polarized plug, make sure that the ridged or striped half of the cord lines up with the wider (neutral) prong of the plug
- Squeeze the prongs of the new quick-connect plug together slightly and pull the plug core from the casing. Cut the old plug from the flat-cord, leaving a clean cut end
- Feed unstripped wire through rear of plug casing. Spread prongs, then insert wire into opening in rear of core. Squeeze prongs together spikes inside core penetrate cord Slide casing over core until it snaps into place
Warnings about Polarized Electrical Plugs, Receptacles, and Lighting Fixtures
Reversed polarity shock hazards: "Polarity" in an electrical receptacle and on the device that plugs into or connects to it means that we're making sure that we connect the "hot" or "live" side of the electrical circuit to the connection point in the appliance or device that was intended to be "hot" or "live".
Carson Dunlop's sketches show why it's important to respect polarity when connecting an electrical receptacle, a lamp or any other appliance. In short, reversed polarity on a light fixture means it's easier to receive a dangerous electrical shock by touching the shell of the bulb socket or even the side of the bulb itself while screwing in a new light bulb.