forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Parsing Help

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Tue Nov 04, 2003 3:18 pm    Post subject: Parsing Help Reply with quote

Anyone any ideas how i can get the following:

Quote:
Interface Statistics

Received Sent

Bytes (there is a big blank space here) 55456730 (there is a big blank space here) 54716816
Unicast packets 123267 123272
Non-unicast packets 15532 294
Discards 0 0
Errors 0 1
Unknown protocols 0


How can i get the Received Figure and the Sent figure into two seperate varibles, paying attention that they both could increase or decrease in size?

I have tried @tab() as a fieldsep but no joyu

Nathan
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Nov 04, 2003 3:33 pm    Post subject: Reply with quote

Try something like this:

Code:
%%Data = yourlongtextgoeshere
%%Data = @strdel(%%Data,1,@sum(@pos("Bytes",%%Data),5))
%%Bytes = @trim(@substr(%%Data,1,@pred(@pos("Unicast",%%Data))))
info Bytes: %%Bytes


I haven't tried it, so you have to get it working yourself... Wink

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Tue Nov 04, 2003 4:32 pm    Post subject: Reply with quote

Oops, i meant this:

Bytes (there is a big blank space here) 55456730 (there is a big blank space here) 54716816

All i need is the two sets of numbers in two seperate vars.

This numbers may change.

Nathan

Skit your could works to an extent, your code returns

55456730 ( still a big blank space) 54716816

?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nick
Contributor
Contributor


Joined: 15 Aug 2000
Posts: 50
Location: hamburg,nj

PostPosted: Tue Nov 04, 2003 6:11 pm    Post subject: Reply with quote

Hi:

Try this:

Code:

%%data = Bytes        55456730        54716816
%%data = @trim(@strdel(%%data,1,@pos("  ",%%data)))
%%sent = @trim(@substr(%%data,1,@pos("  ",%%data)))
%%recvd = @trim(@strdel(%%data,1,@pos("  ",%%data)))

_________________
nick
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group