You're going to have to learn to detach. This is hard but you have to understand that you can't fix her. She's going to have to fix herself and decide what she wants. What YOU have to do is work on YOU. You are certainly not blameless in how your M ended up in this situation. None of us are. So fix those areas where you have been deficient. Not because you want to win her back. Not because its what she wants. Fix those things because its what YOU need to do to be a better person and father. Be the man that she would be a fool to leave. Your M is salvageable but only if you do the things you need to do to become a better person. She WILL notice.
Me: 48 y/o W: 47 y/o Together: > 20 yrs BD: Dec '15, then S 2nd BD: Mar '16, then I filed for D April '16: started piecing