I receive a text file with unknow number of messages, which I need to read and process each message.
example of a message file. Each message starts with Message and ends with End Message
Message
From:Fred
Hi This is a test one line
End Message
Message:
From:John
This is a two line test
Second line
End Message
I'm looking for help on the best way to read the file and separate it into each message so I can to do some processing on the message content. The only way I could think of is reading it to an array but I'm not sure of how and some messages may have 100+ lines and there is an unknown number of messages in each file.