Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: CSV file with variable types


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
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
<akuketayev@mail.primaticsfinancial.com> 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/


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