SPSS Statistics

 View Only
  • 1.  How to remove unwanted IP addresses

    Posted Thu March 09, 2023 08:14 AM

    HI   I have a large survey dataset in SPSSv27.    Does anyone know how to identify and remove IP addresses from outside the UK? 



    ------------------------------
    Julie Selwyn
    ------------------------------


  • 2.  RE: How to remove unwanted IP addresses

    Posted Thu March 09, 2023 09:09 AM

    Well, you could start here to identify some that are in the UK. That list will be smaller than the list of other values.

    IF you can narrow it down a certain set of values, then you can use SELECT IF with ANY to include just those.

    For example, let's say you know that UK IPs can only start with 128, 127, or 145, then you do say:

    compute #d=char.index(ip_address,".").
    compute ip1=number(char.substr(ip_address,1,#d-1),F3).
    select if any(ip1,128,127,145).
    execute.

    The list of values inside ANY() can be of arbitrary length. The trick of course is knowing the values to include. Maybe the site I gave you is exhaustive; I don't know. This is the only way I can think of off the top of my head to do it.



    ------------------------------
    Rick Marcantonio
    Quality Assurance
    IBM
    ------------------------------



  • 3.  RE: How to remove unwanted IP addresses

    Posted Fri March 10, 2023 10:01 AM

    Many thanks .    I'll try that.   



    ------------------------------
    Julie Selwyn
    ------------------------------