Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Wide .csv file is too wide


From   "Joseph Coveney" <jcoveney@bigplanet.com>
To   "Statalist" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Wide .csv file is too wide
Date   Fri, 18 Jul 2008 12:35:02 +0900

Dan Weitzenfeld wrote:

Some non-Stata-using colleagues elsewhere in the company have created
comically wide .csv files (27,600 columns, 62 rows).  I would like to
insheet the files and -xpose- them to a saner structure, but Stata
won't accept them:

insheet using "${filename}", comma clear
too many variables specified
error in line 62 of file
r(103);

Two questions:
-Assuming the problem is that the width of the .csv file exceeds the
max width of a dataset in Stata, is there a workaround to this issue?
-Any idea why Stata is telling me "error in line 62 of file"?  Why the
last row, when many other rows have the same width issue?

--------------------------------------------------------------------------------

I've seen that on occasion, too, when using -insheet-.  I'm not sure why it
waits until the last row before it balks.  I'm guessing that it has to do
with the EOF indication.  -insheet- is expecting something that's not there
or vice versa.  Try switching to -infile-.

sysuse auto, clear
outsheet price mpg rep78 using 1.csv, comma
// If your first row has variable names, then . . .
infile v1-v3 in 2/l using 1.csv, clear
sysuse auto, clear
outsheet price mpg rep78 using 1.csv, comma nonames replace
// else . . .
infile v1-v3 using 1.csv, clear

Stata/SE/MP has a limit of 32,767 variables, so that's not a problem; you'd
just specify v1-v27600.

Joseph Coveney



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index