Question & Answer
Question
I would like to import a large text file. This particular file has been created with the values separated, not by delimiters, but by specific width for each variable, ie. Fixed-Width. How can I import a fixed width text file using syntax in IBM SPSS Statistics?
Answer
You can use the following syntax to import a text file with fixed width.
The length of each variable must be defined in the syntax.
GET DATA /TYPE = TXT
/FILE = '<path and filename>'
/FIXCASE = 1
/ARRANGEMENT = FIXED
/FIRSTCASE = 1
/IMPORTCASE = ALL
/VARIABLES =
/1 POSTE 0-0 F1.0
INTER 1-4 F4.2
Q2 5-10 F6.2
Q30 11-15 F5.2
Q179 16-17 F2.1
.
CACHE.
EXECUTE.
For more information, please see the online Help system
Related Information
Historical Number
40706
Was this topic helpful?
Document Information
Modified date:
16 April 2020
UID
swg21480266