comp.lang.c
[Top] [All Lists]

Re: string splitting plzzzzzz help me...

Subject: Re: string splitting plzzzzzz help me...
From: Ricky
Date: Tue, 29 Apr 2008 22:29:03 -0700 PDT
Newsgroups: comp.lang.c

On Apr 29, 4:24 pm, xyz <lavanyaredd...@xxxxxxxxx> wrote:
> I have a string
> 16:23:18.659343 131.188.37.230.22 131.188.37.59.1398 tcp 168
>
> for example lets say for the above string
> 16:23:18.659343 -- time
> 131.188.37.230   -- srcaddress
> 22                        --srcport
> 131.188.37.59    --destaddress
> 1398                  --destport
> tcp                    --protocol
> 168                  --size
> i need to split the string such that i need to get all these
> parameters....
>  the field widths are not fixed..i have some times four/three digits
> srcport ..so i cant do it with substr function...i need this in c++
> i am not getting an idea how to split it..
> thank you for any help

hi,
You can also use space (' ') to break the original strings and then
parse on the individual strings (after separating it on space taken)
to get your results.
- Ricky

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy