Disferente
Programmer
I need to get information from a set of textfiles, the info I want to get from the files is what is different between them.
To do this I have made a template; a copy of one of the files, removed the changing text and only kept what is the same, then I added variable names where the deleted text was.
I have a working way to do it now, but it is very slow;
I go byte by byte and check for differences between the template and the sourcefiles. If I find a difference and it is a varname (I use "{1{VarName}1}" without the quotes, the number because there are places where the info is nested, so if there are {2{Varname}2} inside the first it re parses the info inside.) I continue going in the sourcefile until I find the end of the difference and then copy that text to varname.
What I need is some faster method to do this, as 10-20 seconds for a 50kb file is too much.
Could someone please help me?
(I hope I have described it so someone can understand... If not, just ask on what part I not explained enough.)
To do this I have made a template; a copy of one of the files, removed the changing text and only kept what is the same, then I added variable names where the deleted text was.
I have a working way to do it now, but it is very slow;
I go byte by byte and check for differences between the template and the sourcefiles. If I find a difference and it is a varname (I use "{1{VarName}1}" without the quotes, the number because there are places where the info is nested, so if there are {2{Varname}2} inside the first it re parses the info inside.) I continue going in the sourcefile until I find the end of the difference and then copy that text to varname.
What I need is some faster method to do this, as 10-20 seconds for a 50kb file is too much.
Could someone please help me?
(I hope I have described it so someone can understand... If not, just ask on what part I not explained enough.)