LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2005)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 19 Dec 2005 17:42:13 -0600
Reply-To:     "Peck, Jon" <peck@spss.com>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         "Peck, Jon" <peck@spss.com>
Subject:      Re: Importing Text File with Defined Decimal
Comments: To: "Meyer, Gregory J" <gmeyer@UTNet.UToledo.Edu>
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.)

Regards, Jon Peck SPSS

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Meyer, Gregory J Sent: Monday, December 19, 2005 9:16 AM To: SPSSX-L@LISTSERV.UGA.EDU Subject: [SPSSX-L] Importing Text File with Defined Decimal

Dear list,

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.

Thanks,

Greg

-------- GET DATA /TYPE = TXT /FILE = 'C:\Temp\test.txt' /DELCASE = VARIABLES 10 /DELIMITERS = "," /QUALIFIER = '"' /ARRANGEMENT = DELIMITED /FIRSTCASE = 1 /IMPORTCASE = ALL /VARIABLES = name a40 gender a1 var01 F3 var02 F5.1 var03 F3 var04 F5.1 var05 F3 var06 F3 var07 F6.2 var08 F1 . CACHE. EXECUTE.

-------- Example Data: "John Smith",M,13,53.0,4,41.5,-1,0,0.30,4 "Jane Doe",F,14,54.5,4,45.5,1,-1,0.82,2


Back to: Top of message | Previous page | Main SPSSX-L page