Combining Two codes into one (Micro SD shield and Gas sensor)

Writing to a file is just like writing to Serial. Replace "Serial.print(value);" with "file.print(value)". You only then need to open a file on the SD card.