Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: CSV file with variable types
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: CSV file with variable types
Date
Wed, 4 May 2011 23:45:22 +0100
Stata can't read strings longer than 244 characters into variables.
What's happening, as I wrote in answer to one of your previous
questions, is indeed that Stata is peeking at the early part of the
data. If it read all the way to the end to work out what it had to do
before it actually did it, it would be even slower.
This is just another example of how -insheet-, although I've found
that it works well for many files smaller and simpler than yours, is
not up to scratch for what you want.
It's not true that -infile- requires those separators. You can read in
other files too.
Either way, your 600 character strings can't be read into Stata
without previous surgery.
That's the main crunch.
Nick
On Wed, May 4, 2011 at 11:31 PM, Argyn Kuketayev
<[email protected]> wrote:
> Hello
>
> I have a pipe-delimited text file. A few variables in the file have
> length of 600 characters. Unfortunately, if I use -insheet- it sets
> the variable type to str150, I suppose because first few values were
> short. -infile- command seems to require tab or comma separated files.
>
> I need to read this file into Stata. Any ideas?
>
*
* 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/