hello
i am new but i think u can do it with php, php can read text files and look for lines,
i think about a loop , with preg match , the loop go from first line to the end , preg match function looks for the data then when it is found use write functions to open new file and paste the lines that have that data
sorry dont know how to write it ,