From: Jai Sharma <jai.unix@gmail.com>
To: linux-c-programming@vger.kernel.org
Subject: extract the data from buffer
Date: Fri, 16 Jan 2009 21:24:11 +0530 [thread overview]
Message-ID: <1f714d50901160754m4568738ev27879b0e9ba72fab@mail.gmail.com> (raw)
Hi
I want to extract variables values from a string buffer. Can anyone
pleease tell me how can i do that.
In C how to use perl like regular expressions.
Channel Location State Application(Data)
SIP/5078-099b4b48 s@newvcci:1 Ringing AppQueue((Outgoing Line))
SIP/66.119.60.21-099 s@tracphone:6 Up Queue(tracphone||||3600)
SIP/5080-09964168 s@newvcci:1 Up Bridged Call(SIP/66.119.60.21-
SIP/66.119.60.21-099 s@tracphone:6 Up Queue(tracphone||||3600)
SIP/5079-09924998 s@newvcci:1 Up Bridged Call(SIP/66.119.60.21-
SIP/66.119.60.21-099 s@tracphone:6 Up Queue(tracphone||||3600)
SIP/5041-0993ee38 s@newvcci:1 Up Bridged Call(SIP/66.119.60.21-
SIP/66.119.60.21-099 s@tracphone:6 Up Queue(tracphone||||3600)
SIP/5010-098e7760 tsihomephoneservice@ Up Bridged Call(SIP/63.111.11.135
SIP/63.111.11.135-09 tsihomephoneservice@ Up Queue(tsihomephoneservice||||9
10 active channels
5 of 200 max active calls ( 2.50% of capacity)
I want to extract three numeric data fields from last line:
as
%d of %d max active calls ( %l% of capacity)
result : 5,200,2.50
means 2.5
Thanks and Regards
Jai
next reply other threads:[~2009-01-16 15:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-16 15:54 Jai Sharma [this message]
2009-01-16 16:55 ` extract the data from buffer Jesse Ruffin
2009-01-16 17:31 ` ben
2009-01-16 17:47 ` ben
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1f714d50901160754m4568738ev27879b0e9ba72fab@mail.gmail.com \
--to=jai.unix@gmail.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).