Hi all,
I have a table with 3 column(source ipaddress, destination ipaddress, start time), which every source ipaddress assign many record of every destination like below.
source ip destination ip stime
0.0.0.2 0.0.0.4 5
0.0.0.1 0.0.0.3 4
0.0.0.2 0.0.0.4 7
0.0.0.2 0.0.0.4 10
0.0.0.2 0.0.0.3 4
I want to get diffrence of stime between 2 ip addresses like 0.0.0.2 and 0.0.0.4. I must compute diffrence stime of first and second record of these ip adresses like : (7-5) and second record with third (10-7).
Let me know how can I do?
I should do for every source ip address with destination ip addresses.
Loading
VulpesPosted Feb 4, 2014, 4:22 PM
The file should contain the following:
diamond diamondPosted Feb 4, 2014, 11:53 PM
you are same as an angel
diamond diamondPosted Feb 4, 2014, 12:08 PM
I want save in an txt file like below:
source ip destination ip difference
0.0.0.2 0.0.0.4 2
5
0.0.0.2 0.0.0.30 10
5
6
,
....
I need urgently, if you have an idea, please share with me.
Thanks
VulpesPosted Feb 2, 2014, 3:51 PM
diamond diamondPosted Feb 2, 2014, 3:15 PM
I should say that my data is very large, and the above data is an example. I want similar records of 2 ip addresses get save in lists, then automatic is computed difference of stimes and save in txt file for all ip addresses. for example records of 2 ip adresses are 12 records and I have compute their difference stimes
Thanks in advance,
diamond diamondPosted Feb 2, 2014, 12:22 PM
Let me test it, and if I had a question, I ask you.
Thankssss again
VulpesPosted Feb 2, 2014, 10:38 AM
Here's some sample code:
The output is:
diamond diamondPosted Feb 2, 2014, 12:11 AM
Dhirendra MisraPosted Feb 1, 2014, 7:12 PM
I think you you would be getting the result at datatable or DataSet.
If so you can make use of dataview and get sorted resultset then use foreach to traver each record and then calculate the difference.
Details on dataview can be found here:
http://www.dotnetperls.com/dataview
Hope it will help you.