These instructions will show you how to replace a cord. Whether you want to replace the socket, the switch, the cord, or everything in the lamp, the following instructions will cover these topics.
Some lamps have a felt cover to protect against scratches. If you are replacing the whole socket assembly you will need to remove this felt cover in order to access the threaded pipe inside the lamp. You can do it yourself using a hot glue gun. See Adding felt to the bottom of a lamp or consider a lamp specialist (search online or check with a local lighting store).
Rewire a Lamp Instructions