Cant make use of the info from an sdcard.

Hello. I am new to Aurduino. I started with basic and moved to c++ and the first project I do had to be the most complicated thing I could think of. If part of my project looks like something you wrote, Thanks for the help this far.It isn't just all copy and paste though I have spent hours a day for about 4 months going crazy and it has come to this. Here is a condensed version of my project and my issue.
I am talking to a phone app, that sends to a hc-06 bluetooth a file name, for instance "the cow jumped over the moon". My program adds ".txt" to the end of that, opens the file from an sdcard, then reads the file which contains 2 servo positions written like this " 90a,180b " . Then the program is supposed to read that info and make servoa go one way and servob go another way and turn on a laser at the end. eventually I plan on putting 320 lets say 8 letter 8 word files on the sdcard with different servo positions in each file. The first part of the program works, the second half works but I cant get the second half to read the contents of the file. I can manually enter the servo positions into the serial monitor and the second half of the program works. Sorry if my program is condensed and has little comments. I will comment in where i think the problem starts. Your help will keep me from going crazy, thanks.

#include <Servo.h>
#include <SPI.h>        //  needs to send a responce to the servos and turn on the laser.
#include "SdFat.h"      //
#include <SoftwareSerial.h>
SdFat SD;
String value="";                    
String txt;
String theFile;
String readString;
int x;
int TxD = 3;                     
int RxD = 10;                    
int servoposition;
SoftwareSerial bluetooth(TxD, RxD);
File myFile;   
Servo myservoa, myservob;      
  
 
void setup() {
 pinMode(8,OUTPUT);
 
 myservoa.attach(6); 
 myservob.attach(9);
 String txt= ".txt";
  bluetooth.begin(9600);
 Serial.begin(9600);
 (SD.begin(4));
 Serial.println("servo all-in-one test code 12-25-13"); // so I can keep track of what is loaded
 Serial.println();
}

void loop() {
  bluetooth.begin(9600);
 String txt= ".txt";
 if (bluetooth.available())
  value = bluetooth.readString(); 
   { 
   if(value==0){
     theFile=String(value);
   }  
   else{
   theFile= String(value)+(txt);     
   {
   //Serial.println(theFile);
   Serial.readString();
    
   while (!Serial); 
    if (!SD.begin(4)) {
 }
 myFile = SD.open(theFile);
 if (myFile) {
   //Serial.println("theFile:");
   while (myFile.available())  
     Serial.write(myFile.read());
     
    // This is where the program is seperated.-------------------------  
   
   //expect single strings like 70a, or 180b,   or combined like 180b,70a,
  if (Serial.available())  {
   char c = (Serial.read());  //gets one byte from serial buffer
   //Serial.println(theFile);
   if (c == ',') {
     if (readString.length() >1) {
       Serial.println(readString); //prints string to serial port out
       int n = readString.toInt();  //convert readString into a number
      Serial.println(int n);
      // auto select appropriate value, copied from someone elses code.
       if(n >= 500)
       {
         Serial.print("writing Microseconds: ");
         Serial.println(n);
         if(readString.indexOf('a') >0) myservoa.writeMicroseconds(n);
         Serial.println(n);
         if(readString.indexOf('b') >0) myservob.writeMicroseconds(n);
         
       }
       else
       {   
         Serial.print("writing Angle: ");
         Serial.println(n);
         if(readString.indexOf('a') >0) myservoa.write(n);
         if(readString.indexOf('b') >0) myservob.write(n);
         
       }
        readString=""; //clears variable for new input
     }
   }  
   else {     
     readString += c; //makes the string readString
   }
 } 
//    myFile.close();
 } 
}       // no laser attached yet
 }
}
}

(MOD EDIT)

Sorry I messed up my post, I'm new at forums also.

Weldersk:
Sorry I messed up my post, I'm new at forums also.

Click the "More..." link at the bottom of the "messed up" post, then "Modify". Now you can start working to fix the problem.

The first thing to do is to remove your failed code tags from the text of your reply. You'll notice that the code tags markup started and ended before the text of the code, then you have another set of tags at the end of the code text. You need to make sure that the code tags markup opens at the start of the text of the code and then doesn't close until the end of the text of the code.

Next is to add code tags properly. To do this, you need to select the full text of the code , before clicking on the code tags button (</>) on the forum toolbar.

Once you think you have it all fixed up, click the "Preview" button and check if it looks as you expected. If it's all good, then click the "Save" button. If it's still not right, keep working at it until you get it.