SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only
  • 1.  Importing XML(?) data into SPSS?

    Posted Wed March 17, 2021 01:43 PM

    Hi there!

    I'm looking to import the following data into SPSS, and I'm wondering how I would do so (variable names and associated data redacted)? The file itself is a .txt file, but I've been told the data is in XML format (I'm not familiar with XML).

    <case variable1="data" variable2="data" variable3="data"></case>

    This code repeats for each case and has many more variables within the tags.

    I've tried to import it into SPSS, although the data is not neatly divided into separate columns. SPSS creates a bunch of variables (and places each case on a separate row) but the data under each variable shows as variable1=data in one column, variable2=data in another column, etc. with generic variable names for each column.

    I'm happy to elaborate further if needed. Thank you!






    #SPSSStatistics
    #Support
    #SupportMigration


  • 2.  RE: Importing XML(?) data into SPSS?
    Best Answer

    Posted Wed March 17, 2021 08:01 PM

    I think the SPSS Data Access Pack includes an ODBC driver for XML - your data is definitely in xml format. I don't have the DAP available right now, but it is included with the SPSS Statistics license and should be available from the IBM Passport Advantage site if you have access to that. If so, you can install the xml driver and then use the Database Wizard to read the data.

    Otherwise, if you are comfortable with Python, you could use its xml tools within Statistics to create a dataset from an XML file.

    A third possibility and probably the easiest if you have Excel would be to read the file into Excel, which support XML format, and save it as an Excel file that you could then read into Statistics via File > Import Data > Excel.






    #SPSSStatistics
    #Support
    #SupportMigration