~ところだった
Almost …; nearly …
N2
V dictionary form/V-ない + ところだった (もう{少|すこ}しで/{危|あぶ}なく~ところだった)
~ところだった says something (usually bad) nearly happened but in fact did not ({危|あぶ}なく{遅刻|ちこく}するところだった). It follows the dictionary or nai-form, often with 「もう{少|すこ}しで」 or 「{危|あぶ}なく」, and a rescuing condition or reason often comes first (「~てくれなかったら」). It is common in conversation. Unlike N3 「~そうになった」 (nearly, often an involuntary action such as falling) and N4 「~ところだ」 (about to do), 「ところだった」 looks back at a danger that has passed.
Examples
目覚まし時計が鳴らなくて、危なく朝の会議に遅れるところだった。
My alarm didn't go off and I nearly missed the morning meeting.
山田さんが気づいてくれなかったら、間違った薬を渡すところだった。
If Mr. Yamada hadn't noticed, I would have handed over the wrong medicine.
もう少しで、大事なデータを消してしまうところだった。
I came very close to deleting important data.
Exercises
1.佐藤さんが教えてくれなかったら、今日の締め切りを忘れる 。
2.雨で道が滑りやすく、配達中にもう少しで事故を起こす 。