filtering out matching IP addresses in form of 172.20.xxx.xxx from a cell S
Show older comments
a and b is given in the problem in the form of cell as shown below. actually a and b are two columns of a nx2 cell
>> a = s(:,1);
a =
'172.20.113.214'
'172.20.113.214'
'46.45.178.252'
'46.45.178.252'
'172.20.113.214'
'172.20.113.214'
'172.20.113.214'
'95.211.85.42'
'172.20.113.214'
'172.20.113.214'
'172.20.113.214'
'172.20.113.214'
'172.20.113.214'
'46.45.178.252'
'46.45.178.252'
'46.45.178.252'
>> b = s(:,2);
b =
'172.20.113.214'
'79.141.216.70'
'79.141.216.70'
'172.20.113.214'
'172.20.113.214'
'172.20.113.214'
'115.112.2.20'
'172.20.113.214'
'115.112.2.20'
'115.112.2.20'
'172.20.113.214'
'172.20.113.214'
'115.112.2.20'
'115.112.2.20'
'172.20.113.214'
'172.20.113.214'
'115.112.2.20'
'115.112.2.20'
'115.112.2.20'
'115.112.2.20'
'172.20.113.214'
'115.112.2.20'
'94.23.30.97'
'115.112.2.20'
'115.112.2.20'
the problem statement is that we have to filter out a certain list of resolved host names from the n x 2 cell S.
say we have to remove all the traffic which does belong to this list of hosts C. C is given something like
>> c
c =
'172.20.xxx.xxx' - filtering for the whole subnet
'79.141.216.xx'
'95.211.85.42'
we have to remove the whole row from S in which any of the strings given in c occurs.
say if '172.20.113.214' occurs in a(1) then remove the first packet of a , if '79.141.216.70' appears in b(2) and b(3) then we should get the output with no string equal to any of the strings given in c.
each of the string of cell c has to be removed in the initial cell S , whether it is in (:,1) or (:,2) .
3 Comments
Rick Rosson
on 27 Apr 2012
What have you done so far? What questions do you have?
Walter Roberson
on 27 Apr 2012
In past questions you have already been shown how to regexp() and how to strcmp(). Are you still stuck on the question of how to determine the pattern to match against according to whether there are wildcard characters in the target ?
Karan
on 27 Apr 2012
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB Coder in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!