Middle school students make their own lamps in shop class. Repairing a lamp is only marginally more difficult. Instead of throwing away the floor lamp that has so dutifully illuminated your life throughout the years, repair it. A few parts, a new set of wire and about an hour's worth of effort is all that is needed to save your floor lamp from the dumpster.
Visit your local hardware store and purchase a 4-piece socket (which includes a socket, a switch, a cap, and a shell) and a moulded-polarised plug with attached lamp cord (18/2 gauge U.L. rated).
Unplug your lamp. Remove the lamp shade and loosen the socket screw where it attaches to the lamp's pipe. Once the cord is exposed, cut it with wire dykes. Pull the rest of the cord out of the lamp through the bottom.
Feed a string or thin piece of wire down the lamp's pipe. Tie your new cord to this snake and pull the wire up from the base of the lamp until you have about 8 inches protruding from the lamp's pipe.
Slip the new socket's cap over your new wire. Screw the cap to the lamp's pipe using the screw already set in the cap.
Seperate the wire by pulling the two strands apart for approximately 6 inches.With the two wires, tie an Underwriter's Knot (loop the two wires and pass the ends through the opposite loops on opposite sides) and pull tight.
Strip the insulation from about 1/2 inch from the end of each wire. Be careful not to damage the copper wire itself. Make sure the exposed copper is not frayed and trim it back further if necessary. Twist the copper strands slightly to keep them together.
Identify the lead wire (usually noted by a white strip in its insulating rubber) and loop the exposed copper around the silver screw. Tighten the screw with a flat head screwdriver to secure the wire tightly to the socket. Repeat the process for the remaining wire by attaching it to the brass screw.
Slip the socket's shell over your switch and seat it within the socket's cap. The shell should lock itself into the cap if you press firmly and evenly. Screw in a light bulb. Replace the shade. Plug the lamp in again.
As easy as repairing a lamp is, you may still be better served to just take the lamp to a repair shop. The cost is sometimes cheaper than buying the parts yourself, especially if there is something unusual about the lamp's wiring.
Make sure the lamp is unplugged. Be sure you are using the proper gauged cord.