SPSS Statistics

 View Only
  • 1.  Removing HTML tags from variable labels

    Posted Thu May 19, 2022 02:16 AM
    Hi,
    I've been looking around a bit for a solution on how to automate cleaning variable labels.
    In particular, removing HTML tags. I know there's a way to clean up tags with 
    Python library BeautifulSoup and R package rvest . But is there a tool within SPSS itself?
    I don't mind where labels will be cleaned up, in the data itself or in the tables output.
    Concerning tables output, is MODIFY OUTPUT an option or MODIFY TABLES?
    Anyone who has experience with this kind of manipulations?

    Thank you!

    Tal

    ------------------------------
    Tal van Dijk
    ------------------------------

    #SPSSStatistics


  • 2.  RE: Removing HTML tags from variable labels

    IBM Champion
    Posted Thu May 19, 2022 09:24 AM
    Attached is a short begin program block of code that cleans html tags out of the variable labels.
    It's less than 10 lines of code, but it is an attachment in order to preserve the formatting.

    --





  • 3.  RE: Removing HTML tags from variable labels

    Posted Sun May 22, 2022 03:05 AM
    Thank you Jon! Much appreciated.
    I'll try it out.

    ------------------------------
    Tal van Dijk
    ------------------------------



  • 4.  RE: Removing HTML tags from variable labels

    IBM Champion
    Posted Sun May 22, 2022 08:38 AM
      Hmmm.  Sometimes this site strips attachments.  Trying again.  If this doesn't work, send me a direct email at my address,and I'll send it that way.

      

    --