I am writing a front-end for a command line utility in Objective-C (Cocoa). I need to parse the output to check for different types of messages. There are two basic types; information messages and download status messages. Information messages always begin with one of the following: INFO:, WARNING:, ERROR:, or : . The download status messages look like the following: 60.56MB / 237.03MB 1526kbps 25.5%, 00:15:47 remaining
I need to detect which of the two types of messages a string is and if it is a download status message, parse out the percentage and speed. If it is an information message, I will simply append it to the log. I know I will need an NSScanner to parse out the components. What I really can't figure out is how to check if it is a download status message. The first three types of information messages are fairly easy to detect but the fourth type I am unsure on as well.
Any help would be greatly appreciated.
Thanks, Thomas