SD card read config.txt file to get values

I have project using ESP8266 and the SD card to make Pixel Led Animation
The Animation file is Store in SD as "RGBmatrix.dat" and the following code is working 100%
But I need to reed another file in SD card Name "Config.txt" whish is having 2 lines
NUM_LEDS= 168
PIXEL_TYPE= WS2811

so following line setting should be as per the config file data.
FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
so how I can get this setting values to store for above line.
following is the code which is working by giving WS2812 and NUM_LEDS
But I need to get those values from Config.txt file

#include <FastLED.h>
#include <SPI.h>
#include <SD.h>

#define NUM_LEDS 168
#define DATA_PIN D3
#define PIN_SPI_CS D8 
#define BRTNS 160


File fxdata;
CRGB leds[NUM_LEDS];

void setup()
{
  //FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); //se doc for different LED strips
  FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
//  Serial.begin(BAUD_RATE); // when using Glediator via usb
  FastLED.setBrightness(BRTNS);
  
  for(int y = 0 ; y < NUM_LEDS ; y++) 
  {
    leds[y] = CRGB::Black; // set all leds to black during setup
  }
  FastLED.show();

  pinMode(10, OUTPUT); // CS/SS pin as output for SD library to work.
  digitalWrite(10, HIGH); // workaround for sdcard failed error...

  if (!SD.begin(PIN_SPI_CS))
  {
    Serial.println("sdcard initialization failed!");
    return;
  }
  Serial.println("sdcard initialization done.");
  
  // test file open
  fxdata = SD.open("RGBmatrix.dat");  // read only
  if (fxdata)
  {
    Serial.println("file open ok");      
    fxdata.close();
  }
}




  
  // close the file in order to prevent hanging IO or similar throughout time
  fxdata.close();
}

Your other topic on the same subject deleted.

Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.

Please create one topic only for your question and choose the forum category carefully. If you have multiple questions about the same project then please ask your questions in the one topic as the answers to one question provide useful context for the others, and also you won’t have to keep explaining your project repeatedly.

Repeated duplicate posting could result in a temporary or permanent ban from the forum.

Could you take a few moments to Learn How To Use The Forum

It will help you get the best out of the forum in the future.

Thank you.

is global object, you cant pass new value of NUM_LEDS to it