During working on https://github.com/dervan/avro-fastserde I had to compare automatically generated code files. I had to directories with files generated by new and old version. Some of the files were generated more than one time, but with the same content. There was also a difference in random numbers, which were added on end of variables name. It’s pretty simple, but I like my one-liner, so I would love to save it here.
Building blocks are:
a) to find java files, each name just once:
b) regex to change a random number to string “ID”:
c) vim flag to quietly run a command in all windows after files loading:
d) find a flag to quit after first finding:
Well, and problem solved in only 210 chars 🙂