If you are reading in Excel data using
GET DATA /TYPE=XLSX type code, is there any way of specifying multiple (distinct, or even overlapping!) cell ranges? e.g. if I want to read in cells A1:M1 and A3:M8, what do I need to put in for the /cellrange = range ' ' command? Scenario is reading in a top row of names (which I'd like to keep) and avoiding a second row of comments that precedes the third row onwards of actual data, without hacking around at all with the Excel file (I like to programme everything if possible) Syntax manual is not illuminating on this! ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
The manual is probably not enlightening
because non-contiguous cell ranges are not supported.
How about removing it after reading the file? Rick Oliver Senior Information Developer IBM Business Analytics (SPSS) E-mail: [hidden email] From: Chris Stride <[hidden email]> To: [hidden email] Date: 06/29/2015 09:34 AM Subject: SPSS to Excel, multiple cell ranges possible? Sent by: "SPSSX(r) Discussion" <[hidden email]> If you are reading in Excel data using GET DATA /TYPE=XLSX type code, is there any way of specifying multiple (distinct, or even overlapping!) cell ranges? e.g. if I want to read in cells A1:M1 and A3:M8, what do I need to put in for the /cellrange = range ' ' command? Scenario is reading in a top row of names (which I'd like to keep) and avoiding a second row of comments that precedes the third row onwards of actual data, without hacking around at all with the Excel file (I like to programme everything if possible) Syntax manual is not illuminating on this! ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
In reply to this post by Christopher Stride
But then, because the second row is a row of comments, it sets all
the vars as strings. Yeah, know I could use alter type to fix that
but for 500+ vars it seems an almighty faff!
On 29/06/2015 15:49, Rick Oliver wrote:
The manual is probably not enlightening because non-contiguous cell ranges are not supported. -- -- Dr Chris Stride, C. Stat, Statistician, Institute of Work Psychology, University of Sheffield Telephone: 0114 2223262 Fax: 0114 2727206 "Figure It Out" Statistical Consultancy and Training Service for Social Scientists Visit www.figureitout.org.uk for details of my consultancy services, and forthcoming training courses, which are also available on an in-house basis: - Data management using SPSS syntax - Advanced SPSS syntax and SPSS macros - Testing for Mediation and Moderation using SPSS - Multi-level Modelling using SPSS - Introduction to Structural Equation Modelling using Mplus - Testing for Mediation and Moderation using Mplus - Multi-level Modelling using Mplus - Latent Growth Curve Modelling using Mplus===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Ah, right. How about:
Read the whole file. Delete the first row of data. Write out the data to Excel. Read it back in. Rick Oliver Senior Information Developer IBM Business Analytics (SPSS) E-mail: [hidden email] From: Chris Stride <[hidden email]> To: Rick Oliver/Chicago/IBM@IBMUS Cc: [hidden email] Date: 06/29/2015 09:53 AM Subject: Re: SPSS to Excel, multiple cell ranges possible? But then, because the second row is a row of comments, it sets all the vars as strings. Yeah, know I could use alter type to fix that but for 500+ vars it seems an almighty faff! On 29/06/2015 15:49, Rick Oliver wrote: The manual is probably not enlightening because non-contiguous cell ranges are not supported. How about removing it after reading the file? Rick Oliver Senior Information Developer IBM Business Analytics (SPSS) E-mail: oliverr@... From: Chris Stride <c.b.stride@...> To: [hidden email] Date: 06/29/2015 09:34 AM Subject: SPSS to Excel, multiple cell ranges possible? Sent by: "SPSSX(r) Discussion" [hidden email] If you are reading in Excel data using GET DATA /TYPE=XLSX type code, is there any way of specifying multiple (distinct, or even overlapping!) cell ranges? e.g. if I want to read in cells A1:M1 and A3:M8, what do I need to put in for the /cellrange = range ' ' command? Scenario is reading in a top row of names (which I'd like to keep) and avoiding a second row of comments that precedes the third row onwards of actual data, without hacking around at all with the Excel file (I like to programme everything if possible) Syntax manual is not illuminating on this! ===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@...(not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD -- -- Dr Chris Stride, C. Stat, Statistician, Institute of Work Psychology, University of Sheffield Telephone: 0114 2223262 Fax: 0114 2727206 "Figure It Out" Statistical Consultancy and Training Service for Social Scientists Visit www.figureitout.org.ukfor details of my consultancy services, and forthcoming training courses, which are also available on an in-house basis: - Data management using SPSS syntax - Advanced SPSS syntax and SPSS macros - Testing for Mediation and Moderation using SPSS - Multi-level Modelling using SPSS - Introduction to Structural Equation Modelling using Mplus - Testing for Mediation and Moderation using Mplus - Multi-level Modelling using Mplus - Latent Growth Curve Modelling using Mplus ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
In reply to this post by Christopher Stride
yeah - that's what I've been doing! :D
Was just wondering if (hoping!) there was a secret subcommand I didn't know about... On 29/06/2015 16:05, Rick Oliver wrote:
Ah, right. How about: -- -- Dr Chris Stride, C. Stat, Statistician, Institute of Work Psychology, University of Sheffield Telephone: 0114 2223262 Fax: 0114 2727206 "Figure It Out" Statistical Consultancy and Training Service for Social Scientists Visit www.figureitout.org.uk for details of my consultancy services, and forthcoming training courses, which are also available on an in-house basis: - Data management using SPSS syntax - Advanced SPSS syntax and SPSS macros - Testing for Mediation and Moderation using SPSS - Multi-level Modelling using SPSS - Introduction to Structural Equation Modelling using Mplus - Testing for Mediation and Moderation using Mplus - Multi-level Modelling using Mplus - Latent Growth Curve Modelling using Mplus===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Free forum by Nabble | Edit this page |