I totally agree @MichiganGeorgia, these type of men are not just in STEM fields, they are everywhere. I think it would depend on how bad it is as to whether or not a woman would leave a STEM field or any other for that matter.
Many moons ago when I went to college at a small branch of the state university I was asked out by two different professors (psychology and math) my very first semester. Now I am a quiet person, and in those days as an 18 year old I was not outgoing at all and quite shy in addition to being quiet. I am not totally unfortunate looking, but am no model either. I have no idea what kind of vibe I put out that made these men feel like I would be open to the proposition of going out with men who were older than my father. Needless to say I did not go out with these men, I felt really uncomfortable and shared these experiences with my girlfriends, but did nothing else but go to class and avoid these men otherwise. I was an undeclared major, and when it was time to declare my major I realized that I would have to work with these two men again due to it being a small school and small department. I elected to transfer to the state flagship. The prospect of having to interact with these two men again did factor into that decision. I did not, however, change my career goals.
I also had another situation later on that was much more subtle and ongoing with a clinical supervisor while working on my graduate internship. Again pre-email/internet, I did not change my career goals, but did choose to leave the community where I had just been establishing career connections because I did not want to have to continue to cross paths with this person anymore.
I am not sure there was a way to report the harassment in those days, and even if there was I doubt it would have made any difference.
I think one problem with this kind of harassment described in the article is that it may have started out in far subtler forms before it was recorded in emails. Often at the level of subtle that the one being harassed feels a queasy uncomfortable sense but then kind of blows it off, that they are the one being silly. It is often not a one time thing but a gradual progression until the person being harassed realizes that things are going too far. It can be very confusing.
And @mreapoe we tell our daughters what sexual harassment is, that it can come in very subtle forms, and to be aware of it. It is a reportable offense now too.