There is a better and quickly way to read a .txt file, find a Match string ?

saormart:
Maybe using a .txt file is a bad idea for that when you need to speed up the query data right ?

Well, if you store the numbers as binary values you would avoid needing to parse each number. But essentially the scheme of putting different ranges of numbers in different files (effectively, using the file system as an index) seems like the simplest way to do it.

I assume that you would put logic in your sketch to receive a number and create the corresponding file (if not already exists) and insert the number into the file at the correct position (if not already present). This process would be a lot easier at the Arduino if you did this work on the PC and just sent the set of files over, or even wrote the files directly to an SD card and just installed that on the Arduino.

This approach might not work so well if the set of supported numbers is very sparse, but it's still the first approach I'd try.