When I was younger I watched a movie that was probably from the 70s. It is a western movie where a lone gunman starts with a brand new book filled with names that he has to kill as well as a pencil. He has a walking stick and uses a white suit (visually to hint that he is a good guy). Throughout the movie, he adds new names to the book. I don’t remember his motivation if whether he is a justice warrior or a bounty hunter, but he kills only criminals.
At the end of the movie, the book has crumpled pages (due to frequent use) and he has just a pencil stump. In other words, he kills a lot of guys.
At the very end, he has to kill the last guy in his book and this guy is a crime boss and evidently, the toughest one. Our “hero” kills the boss’ goons but nevertheless is surrendered by the crime boss that orders him to drop the weapon. And here’s there’s a kind of a plot twist because when the crime boss orders him to also drop his walking stick, his stick it’s actually a camouflaged rifle and then he kills the man.
Other details: I watched this movie in the early 2000s, I do not remember actors names; I do not remember if it was an English movie or a Spaghetti western but it was in color.