I have a block of text (http headers for anyone who is familiar) and would like to print all text before a blank line occurs (since an http header ends with a blank line). The first thing I do is use strstr() to find a keyword, in this case it is "Host:". Then I would like to search for the blank line and print all data in between the keyword and blank line. I have not been able to find a certain character that defines a blank line or an easy way to use a function to find the blank line. Does anybody have a suggestion for the easiest way to do so? I do not want to have to go through every line until a "/r" appears twice in a row.
Example:
(1)Text..........
(2)Host:.........
(3)Text..........
(4)Text..........
(5)Text.........
(6) "Blank Line"
(7)Text.......
(8)Text.........
I would like to print from (2) to (5) (or (6), it doesn't matter) in this case.
Thanks