Assuming each command lies on a line of its own, read in one line at a time, then compare that string to every possible command that can be executed.
I don't know if this is the best way to do this. Should work though...
Code:LineFromFile = ReadInOneLineFromAFile(); if(strcmp(LineFromFile, "Send_To_Origin") == 0) { OutputToFile("G54_X0_Y0_Z0"); } else if(strcmp(LineFromFile, "Rotate_90_Degrees") == 0) { OutputToFile("G54_D90"); } else if(...) ... else { OutputToConsole("Unknown command"); }