how to read dat from a txtfle at the same time when we write to file it should store the details how?