0

I need to compare the two files in Python and then count the number of lines that are changed.

Problem Statement: I have to give a report on monthly basis, that in a project, how many files are present and how many lines each file has and during the time frame of one month, how many lines are changed. So I want to automate this process. So, firstly I started with writing a Python Script which will generate a Excel file containing the number of lines in each file in all the sub-directories of the project directory. This part is done.

Now provided that, I have the Source Code copy from 31st Oct and 30th Nov in two separate directories and, I want to check how many lines are changed during this time interval. Can you guys help me with this, I really don't understand how to proceed further.

xpress_embedo
  • 377
  • 1
  • 4
  • 18
  • why not use source control? It would give you a lot of information? If you need to as well, you might be able to use some bash scripts to diff A and B, but what about the interum of say, A and B and C.... like what if you end up changing a line twice, do you count it twice, or just once? – Fallenreaper Dec 01 '17 at 03:32
  • @Fallenreaper: We are using SVN and as a GUI client tortoiseSVN, does it generate this information automatically? For changing line twice question, that's why I want to take revision at the starting of month and then at the end of month, by this we will check the final changes and not the in between changes. – xpress_embedo Dec 01 '17 at 03:37
  • Depends on how you want to do it. If you want to use your visual Tool, you should follow: https://stackoverflow.com/questions/412129/is-it-possible-to-get-statistics-with-tortoisesvn If you want to get a bit more custom, you should look into the CLI for `svn diff` and maybe run a `grep` and `wc` or few. – Fallenreaper Dec 01 '17 at 03:43

0 Answers0