If the socket and the plug are ruled out as the cause of a lamp malfunction, then wiring must be the culprit. No matter what shape or size the lamp, the wiring is essentially the same: A cord runs from the plug to the socket. A multisocket lamp contains a sort of junction box, where the main cord is spliced to shorter cords that lead to individual sockets.
It is rarely a good idea to replace only part of a cord: The splice is unsightly, and the cord could be damaged elsewhere in the lamp. It's usually not much more work to replace the entire lamp cord.
About 1 hour to rewire a simple lamp
Continuity tester, lineman's pliers, strippers, screwdriver
Stripping wires and connecting them to terminals
Unplug lamp, remove bulb, and place lamp on a work surface.
Lamp cord with molded plug or a rewire kit containing a cord, electrician's tape
Test wires for breaks in continuity. Attach a tester clip to the stripped end of the neutral (ribbed) wire and touch the probe to the wide prong of the plug at the other end. Repeat for the narrow prong and the hot (smooth) wire. If the tester does not glow for both, replace the cord.
To replace the defective cord, begin by cutting the old cord. Strip about 1 inch off the ends of the old and new cord wires. Form hooks on all four wire ends and splice the old to the new in a splice that is thin enough to slide through the lamp. Wrap tightly and smoothly with electrician's tape.
Feed the new cord into the base of the lamp while pulling the old cord through the top. Keep pulling until the new cord emerges. If rewiring a floor lamp, have a helper feed the cord into the base. Separate the cords and discard the old one. Attach the new cord to the socket.