column width set incorrectly when reading in text files

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

column width set incorrectly when reading in text files

mpirritano

All,

 

When reading in some kind of a text file, in this case a csv file, SPSS appears to set column widths based on rows located towards the top of the file. I do not always know the correct number of columns to alot for a field. As a result I often discover upon subsequent analyses that fields have been truncated. Is there some way to ensure that this doesn’t happen, other than knowing the max column width for all fields in every file I load? I’m working with 17.0.3.

 

Thanks

Matt

 

Matthew Pirritano, Ph.D.

Research Analyst IV

Medical Services Initiative (MSI)

Orange County Health Care Agency

(714) 568-5648

 

Reply | Threaded
Open this post in threaded view
|

Re: column width set incorrectly when reading in text files

Rick Oliver-3
The text wizard looks at the first 200 rows to determine string width. If that's not sufficient, you could set some arbitrarily high width for all string variables and then trim them back with:

ALTER TYPE ALL (A=AMIN).

Rick Oliver
Senior Information Developer
IBM Business Analytics (SPSS)
E-mail: [hidden email]
Phone: 312.893.4922 | T/L: 206-4922




From:        "Pirritano, Matthew" <[hidden email]>
To:        [hidden email]
Date:        12/06/2011 01:34 PM
Subject:        column width set incorrectly when reading in text files
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




All,
 
When reading in some kind of a text file, in this case a csv file, SPSS appears to set column widths based on rows located towards the top of the file. I do not always know the correct number of columns to alot for a field. As a result I often discover upon subsequent analyses that fields have been truncated. Is there some way to ensure that this doesn’t happen, other than knowing the max column width for all fields in every file I load? I’m working with 17.0.3.
 
Thanks
Matt
 
Matthew Pirritano, Ph.D.
Research Analyst IV
Medical Services Initiative (MSI)
Orange County Health Care Agency
(714) 568-5648