in reply to Delay in Writing the data to Text file

Unfortunately your post is hard to read, please use <code> tags to format it, see How do I post a question effectively? You also don't seem to have provided any sample input or expected output, please see Short, Self-Contained, Correct Example.

From what I can understand, once per line of input from MSMLogs.txt, you're opening the file one.txt and scanning the entire file, this is probably where the bad performance is coming from. You might consider reading one.txt once into memory (if it's not too big), perhaps storing in in a hash to make access to it faster.