How old are you, 22?
I'm going to assume that you're fairly young, perhaps 22 (as in your screen name?), perhaps even younger. Well. that's a good thing. You've realized the penalty for being a nice guy early enough that if you are careful, and if you act quickly, you might survive intact.
Well, mostly intact.
By the way, don't believe any of the ranting posts above-- nice guys are nice, girls all really want nice guys, etc., etc. That's all taken from a list of talking-points that women are issued about the time they get their adult teeth, and it's all bullshit.
Though it is true that girls want nice guys. You've found that out already. Girls want nice guys to be the shoulder they cry on when their "secure, self-confident" boyfriends screw them over; and they want nice guys to hold their coats and answer their phones while they do the bedroom bounce with their "assertive" boyfriends. Nice guys are also useful, you will find, as kicking-dummies for all the vicious emotional karate that girls like to practice, but are unwilling to use on their chosen bad boys. And nice guys occasionally make good pets for the really hot girls. But hot girls never let their pets sleep on the bed.
Anyway, my point is that you've diagnosed your illness just in time, and you have a chance to cure it before it finishes you. The cure is, of course, to stop being a nice guy. Practice being a not-nice guy. Kill the cute little rascal in you, and bury him at a crossroads at midnight during the dark of the moon. Throw away all your silly notions of chivalry, courtesy, benevolence, and common decency. They have no use in the real world. You do, of course, have to remember how to pretend to courtesy, decency, etc., but you have to be very, very careful not to let the pretense interfere with your "confident, assertive, secure" approach to things.
So, good luck-- you'll need it. I know that it took me the better part of a decade of diligent work to kill or contain the last bits of my unfortunate niceness. But perhaps starting on the job younger, as you can do, will give you an advantage. Your nice guy may not be as deeply embedded as mine was.
When in trouble,
Or in doubt,
Run in circles,
Scream and shout.