Do you do that in the dark, then, after retrieving the leader from the spool with a tool? And how do you know how long corresponds to X number of frames, if it's dark?
When this happens, it will be the last roll of the day, so this is not an issue. I just opened the camera in the dark without rewinding, pulled about an inch extra from the cassete, snipped off the shot film, and put it in a black box.
If not the last roll of the day, you can rewind, leave the leader sticking out, and MARK THE CASSETE. Then use a ruler to measure the numbe of shots you want to trim off, with some extra for safety, of course.
As I said, I have only done this three times. Once was b/w, and I did it at home. The other two were color and I had a lab do them.