Date: Wed, 23 Jul 2003 14:27:41 -0500
Reply-To: "Marks, Jim" <Jim.Marks@lodgenet.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Marks, Jim" <Jim.Marks@lodgenet.com>
Subject: Re: How to deal with "junk" lines in raw data file
Content-Type: text/plain; charset="iso-8859-1"
SPSS can read .csv files directly. You can use the file import wizard to perform the operation. The wizard walks through variable names and types, as well as skipping the first case.
The wizard can also generate syntax, which can be edited/ saved/ reused for routine/ repeat processes.
Here is a sample of GET DATA:
GET DATA /TYPE = TXT
/FILE =
"C:\spss\data1.csv"
/DELCASE = LINE
/DELIMITERS = ","
/ARRANGEMENT = DELIMITED
/FIRSTCASE = 2
/IMPORTCASE = ALL
/VARIABLES =
id A7
date ADATE8
time TIME11.2
name A6
testid F5.0
school F8.0
q1 F3.0
q2 F3.0
Descript A30
.
CACHE.
EXECUTE.
Hope this helps.
Jim Marks
Senior Market Analyst
LodgeNet Entertainment Corporation
-----Original Message-----
From: Snider-Lotz, Tom [mailto:TSnider-Lotz@qwiz.com]
Sent: Wednesday, July 23, 2003 11:01 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Re: How to deal with "junk" lines in raw data file
David,
Rows 3 to the end are data. It's just the first two that are discarded.
Our current method is to open the files in Excel, delete the header row, and then insert two rows at the top of the file: an SPSS-friendly header row, and a dummy case with "good" data. Then we read the XLS file into SPSS.
The current goal is to do away with the Excel step, and just read in the CSV file, warts and all.
-----Original Message-----
From: David Millar [mailto:david.millar@erc.ie]
Sent: Wednesday, July 23, 2003 11:47 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Re: How to deal with "junk" lines in raw data file
Re earlier message
Another option is that you read in the file from Excel, compute a 'row' variable and then delete all but every third one.
e.g.
compute #c=#c+1.
compute case=#c.
execute.
compute retain=mod(case, 3).
execute.
select if (retain=0).
Regards
David