Date: Mon, 19 Dec 2005 17:42:13 -0600
Reply-To: "Peck, Jon" <email@example.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Peck, Jon" <firstname.lastname@example.org>
Subject: Re: Importing Text File with Defined Decimal
Content-Type: text/plain; charset="utf-8"
COMMA format gives a dot decimal worldwide; DOT format gives a comma decimal. F format takes its decimal from the user's locale. You could also use the SET LOCALE command to set a locale with the properties you need. And with a comma decimal, if you have that, you don’t want to use comma as a field separator. (OK of course, with a dot decimal.)
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Meyer, Gregory J
Sent: Monday, December 19, 2005 9:16 AM
Subject: [SPSSX-L] Importing Text File with Defined Decimal
I'm working with a colleague in Italy and we are unable to use the same
syntax to import the same text file, which is in a comma delimited
format. I can use the syntax without problem but when she tries she is
unable to read several variables with defined decimal places. She has no
problems with all the other variables in the file.
I suspect the difficulty has to do with the default setting on her
computer, which is to use periods to delimit every three places in the
number and a comma to identify the decimal indicator. Without having
much expertise in data formats, I tried defining the variable in COMMA
format and N format with no success. On her version of SPSS, the decimal
separator option is checked in Options/Currency.
Below is an example of the syntax for importing the file and a couple of
example lines of data. Any help would be much appreciated.
GET DATA /TYPE = TXT
/FILE = 'C:\Temp\test.txt'
/DELCASE = VARIABLES 10
/DELIMITERS = ","
/QUALIFIER = '"'
/ARRANGEMENT = DELIMITED
/FIRSTCASE = 1
/IMPORTCASE = ALL
name a40 gender a1
var01 F3 var02 F5.1 var03 F3 var04 F5.1
var05 F3 var06 F3 var07 F6.2 var08 F1 .