2010-12-19 89 views

回答

2
#ASSUMING YOUR RUNNIG SOME KIND OF UNIX 
#install a perl module that computes it: 
sudo cpan String::Approx 
# (Note: there is also Text::Levenshtein module) 
# if you need to, change your shell to: 
bash 
# so you can use command substitution: 
perl -M'String::Approx(adist)' -ane 'print adist(@F)' <(paste <(ghead -n -1 in.txt) <(gtail -n +2 in.txt)) 
# note: I have gnu core utils installed with 'g' prefix. You might just use 'head' and 'tail' above.