Re: Question regarding data formatting

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Question regarding data formatting

Melissa Ives

Stace,

Can your file not be read in with space-delimited?
Alternatively, it can be read into Excel, parsed by space delimited and then opened directly in SPSS.

 

Melissa

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of stace swayne
Sent: Monday, July 09, 2012 2:39 PM
To: [hidden email]
Subject: [SPSSX-L] Question regarding data formating

 

 

Dear list,

I have data in a DAT file that looks like this

CSC 100 $10.00 $30.00 $25.00 $10.00 $600.00 $1960.00
USS 165 $9.00 $8.00 $25.00 $16.50 $0.00 $-198.50
ITT 89 $6.00 $18.00 $40.00 $24.92 $512.64 $1012.92
MEL 165 $2.00 $39.00 $42.00 $19.80 $1923.07 $6040.80
WES 59 $4.00 $20.00 $10.00 $7.08 $217.12 $931.08

I would like line the columns of data up, but I'm not sure of an easy way to do this, I have 25,000 cases so I would prefer not to do this manually.

Thanks,

Stace



PRIVILEGED AND CONFIDENTIAL INFORMATION
This transmittal and any attachments may contain PRIVILEGED AND
CONFIDENTIAL information and is intended only for the use of the
addressee. If you are not the designated recipient, or an employee
or agent authorized to deliver such transmittals to the designated
recipient, you are hereby notified that any dissemination,
copying or publication of this transmittal is strictly prohibited. If
you have received this transmittal in error, please notify us
immediately by replying to the sender and delete this copy from your
system. You may also call us at (309) 827-6026 for assistance.
Reply | Threaded
Open this post in threaded view
|

Re: Question regarding data formatting

David Marso
Administrator
Demo:
However with 25K cases inline data is not advised.
Rather:
DATA LIST FREE / FILE ='full path to your file / id (A3) ........

data list free / id (A3) x (F3) amount1 to amount6 (6dollar8.2).
begin data
CSC 100 $10.00 $30.00 $25.00 $10.00 $600.00 $1960.00
USS 165 $9.00 $8.00 $25.00 $16.50 $0.00 $-198.50
ITT 89 $6.00 $18.00 $40.00 $24.92 $512.64 $1012.92
MEL 165 $2.00 $39.00 $42.00 $19.80 $1923.07 $6040.80
WES 59 $4.00 $20.00 $10.00 $7.08 $217.12 $931.08
end data.
list.

ID    X     AMOUNT1     AMOUNT2     AMOUNT3     AMOUNT4     AMOUNT5     AMOUNT6

CSC 100      $10.00      $30.00      $25.00      $10.00     $600.00   $1,960.00
USS 165       $9.00       $8.00      $25.00      $16.50        $.00    -$198.50
ITT  89       $6.00      $18.00      $40.00      $24.92     $512.64   $1,012.92
MEL 165       $2.00      $39.00      $42.00      $19.80   $1,923.07   $6,040.80
WES  59       $4.00      $20.00      $10.00       $7.08     $217.12     $931.08


Number of cases read:  5    Number of cases listed:  5
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Question regarding data formatting

David Marso
Administrator
I would suggest using DATA LIST LIST rather than DATA LIST FREE (in case there are incomplete records).
David Marso wrote
Demo:
However with 25K cases inline data is not advised.
Rather:
DATA LIST FREE / FILE ='full path to your file / id (A3) ........

data list free / id (A3) x (F3) amount1 to amount6 (6dollar8.2).
begin data
CSC 100 $10.00 $30.00 $25.00 $10.00 $600.00 $1960.00
USS 165 $9.00 $8.00 $25.00 $16.50 $0.00 $-198.50
ITT 89 $6.00 $18.00 $40.00 $24.92 $512.64 $1012.92
MEL 165 $2.00 $39.00 $42.00 $19.80 $1923.07 $6040.80
WES 59 $4.00 $20.00 $10.00 $7.08 $217.12 $931.08
end data.
list.

ID    X     AMOUNT1     AMOUNT2     AMOUNT3     AMOUNT4     AMOUNT5     AMOUNT6

CSC 100      $10.00      $30.00      $25.00      $10.00     $600.00   $1,960.00
USS 165       $9.00       $8.00      $25.00      $16.50        $.00    -$198.50
ITT  89       $6.00      $18.00      $40.00      $24.92     $512.64   $1,012.92
MEL 165       $2.00      $39.00      $42.00      $19.80   $1,923.07   $6,040.80
WES  59       $4.00      $20.00      $10.00       $7.08     $217.12     $931.08


Number of cases read:  5    Number of cases listed:  5
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"