Google
 
Web unafbapune.blogspot.com

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:
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

<< Home

This page is powered by Blogger. Isn't yours?