Monday, March 08, 2010
File Diff %
Given two text files v1.txt and v2.txt, how can we easily tell the percentage of total changes (including lines added, changed, and deleted) from v1.txt to v2.txt ?
Comments:
<< Home
Ignoring the empty file case of v1.txt:
echo "scale=2; `sdiff -s v1.txt v2.txt | wc -l`*100/`cat v1.txt|wc -l`" | bc
Post a Comment
echo "scale=2; `sdiff -s v1.txt v2.txt | wc -l`*100/`cat v1.txt|wc -l`" | bc
<< Home