So you have linked to two demo programs - one copies the accelorometer readings to Serial, the other copies 3 analog pin readings to an SD file. What do you want to do ? Copy the accelorometer reading to the SD card?
The "Overview" of what you have to do: Put the the two programs in one file. Take alle the setup() bits and put them in one setup() call. Likewise the loop bits. When this compiles you will need to change the Serial.print() of the accelorometer bit to datafile.print() and remove the analogRead bits.
Hope this gives you enough of a help to finish the details yourself.
(ByTheWay - when you write a post you can can click on AdvancedOptions below the text entry field, and upload large program sketch source code - this way you do not need to make links)