Controlling an LED's intensity with a text file from an SD card
Found on the Arduino Forums, showing how to take a CSV (comma separated value) file like yours, reading it into an array:

  File configFile = SD.open("CONFIG.TXT");
  if(configFile){
    for(int i=0;i&lt;10;i++)
      config[i]=configFile.parseInt();
    configFile.close();
  }


Also the Arduino SD library reference page
The SD library's File class is inherited from the Stream Class and most if not all of it's functions apply to the SD File class, including ParseInt():


  parseInt() returns the first valid (long) integer number from the current position. Initial characters that are not integers (or the minus sign) are skipped. parseInt() is terminated by the first character that is not a digit.


To make an arbitrary file length, you would want to use a combination of the File class size() and available(), and fixed digit format. Instead of 255,4,30,255,0, make sure every number you add is zero padded to 3 digits so you get 255,004,030,255,000,. Then you could simply take the file.size(), divide by 4, and your arduino sketch will know how many numbers are in the file.

I'll leave the rest to you on how to figure it out. You don't have to read it into an array for example. And if you want to use it for two different leds, you could possibly just interspace your data, so that 255,240,000,010,100,255 would be for led1, led2, led1, led2, and so on.