SPSS Statistics

SPSS Statistics

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


#Analytics
#SPSSStatistics
#Analyticstools
 View Only
  • 1.  Importing variables with brackets

    Posted 08/02/21 05:57 PM

    Hi,

    I'm trying to import a .txt file with variable names in second row, some of which contain brackets. Is there a way to customize the syntax so that the brackets are ignored but the variable is still imported?

    GET DATA /TYPE=TXT

    /FILE="/Users/me/Desktop/U0XXXRB.txt"

    /ENCODING='UTF-16LE'

    /DELIMITERS="\t"

    /QUALIFIER='"'

    /ARRANGEMENT=DELIMITED

    /FIRSTCASE=3

    /DATATYPEMIN PERCENTAGE=95.0

    /VARIABLES=

    BlockList.Cycle AUTO

    BlockList.Sample AUTO

    Procedure[Block] AUTO

    The syntax won't run when brackets are included, and when removed, the variable is skipped because it doesn't match the name in the txt file.

    Thanks!






    #SPSSStatistics
    #Support
    #SupportMigration


  • 2.  RE: Importing variables with brackets
    Best Answer

    Posted 08/02/21 06:09 PM

    There is no direct way to do this. The choices are

    1. set the syntax so that it specifies no variable names and rename after import
    2. open the file in a text editor and delete the brackets
    3. maybe, include [and ] in the list of delimiters. I don't recall exactly how multiple adjacent delimiters are handled by that command.





    #SPSSStatistics
    #Support
    #SupportMigration