He knew that he had worked for weeks and months to get up his facts, and he was beginning to know that he had worked in vain. 
He knew that he had worked for weeks and months to get up his facts, and realised that he had worked in vain. 