| View previous topic :: View next topic |
| Author |
Message |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Tue Nov 04, 2003 3:18 pm Post subject: Parsing Help |
|
|
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 |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Tue Nov 04, 2003 3:33 pm Post subject: |
|
|
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...  _________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
| Back to top |
|
 |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Tue Nov 04, 2003 4:32 pm Post subject: |
|
|
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 |
|
 |
nick Contributor

Joined: 15 Aug 2000 Posts: 50 Location: hamburg,nj
|
Posted: Tue Nov 04, 2003 6:11 pm Post subject: |
|
|
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 |
|
 |
|