i was learning string parsing using c++.
i came across a problem where there are many delimiters and specific string needs to be selected from the given successive line
input was like this ans we need to filter computer name , date and connection status from it .
[0BBB] ComputerName:Acer UserID:A90 Laua Lon Station 9 LanId: | (12/21 12:30:49) | Client disconnected.
[0BBB] ComputerName:Samsung UserID:A01 Laua Long Station 9 LanId: | (12/21 12:30:54) | Client connected.
and many more strings
please can anyone help in how to separate computer name, date and connection status from these successive strings.
if you have that whole thing as one string, you can use repeated calls to find() to locate the keywords and then pull out what is between keywords or spaces or whatever the back side delimiter is using a substring.
The information, as given in your post, is not clearly delimited.
I would think that the individual fields would be TAB-delimited, but without that I cannot make any assumption.
You can still get the named elements easily enough.