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
VulpesRank #55 · 29.2K reputationPosted Feb 4, 2014, 11:22 AM EST
The file should contain the following:
Dhirendra Misra6 reputationPosted Feb 1, 2014, 2:12 PM EST
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.
diamond diamond131 reputationPosted Feb 1, 2014, 7:11 PM EST
VulpesRank #55 · 29.2K reputationPosted Feb 2, 2014, 5:38 AM EST
Here's some sample code:
The output is:
diamond diamond131 reputationPosted Feb 2, 2014, 7:22 AM EST
Let me test it, and if I had a question, I ask you.
Thankssss again
diamond diamond131 reputationPosted Feb 2, 2014, 10:15 AM EST
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,
VulpesRank #55 · 29.2K reputationPosted Feb 2, 2014, 10:51 AM EST
diamond diamond131 reputationPosted Feb 4, 2014, 7:08 AM EST
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
diamond diamond131 reputationPosted Feb 4, 2014, 6:53 PM EST
you are same as an angel
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts