Text File Comparison
- Posted by petelomax at blueyonder.co.uk Feb 08, 2002
- 545 views
Looking for a source file comparison utility - must be written in Euphoria or a source I can translate. Thinking out loud, it seems non-trivial to report the smallest possible number of changed lines, which is what I want. At the moment I'm struggling with DOS fc utility but I'd like an output similar to: function fred() sequence result >integer i result={} < for i = 1 to 10 < if skip[i]=0 then > i=1 > while i <= 10 > if skip[i]>0 then > i+=skip[i] > else result&=i > i+=1 end if < end for > end while return result end procedure whereby ">" lines have been added & "<" removed. Hopefully someone out there in the Linux world has the source of "diff" I think it is which I suspect handles this alot better than I could starting from scratch. Using fc I get alot of false realigns on "end if" causing the output to be much larger than it ought to be. Raw performance is unlikely to be an issue. Pete