Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

Re: st: insheet limit in string

From   Nick Cox <>
Subject   Re: st: insheet limit in string
Date   Fri, 9 Dec 2011 01:00:01 +0000

This is several questions bundled together.

1. str244 is an absolute limit in Stata 11 and in Stata 12 at present.

2. You are not alone in wanting bigger limits; the request is often
made at users' meetings.

3. -split- only works on existing variables that have been read in or
created. Its syntax is independent of -insheet-.

4. -insheet-'s -delimiter()- option specifies what separates fields
defining two or more variables. I don't understand your question here.

5. In addition to the approaches suggested by Matthew you could work
with longer strings in Mata. The thread in September gave examples of
this approach. But despite what you say parsing on ; looks your best
option to me.


On Thu, Dec 8, 2011 at 11:30 PM, Mike Kim <> wrote:
> Hi Matt,
> Yes, I tried filefilter, etc. but it didn't work. For example, I changed ";
> [" into "^" or "???"and used insheet. The result is completely mess (with ^)
> or error (with ???). Does delimiter option in insheet work only with one
> variable? If data has several variable, the imported data becomes total mess
> with delimiter option. Then, maybe the only option is to save my school
> variable as a separate file and import using delimit option and merge again?
> I have 40 of these files to import, but it is doable. The only question
> is... why does Stata create this pain?
> Mike.
> -----Original Message-----
> From:
> [] On Behalf Of Matthew White
> Sent: Thursday, December 08, 2011 4:22 PM
> To:
> Subject: Re: st: insheet limit in string
> Hi Mike,
> There was a discussion about a similar problem not too long ago.
> Google "String variables over 244 in a dataset with two delimiters"
> and see if that helps.
> Best,
> Matt
> On Thu, Dec 8, 2011 at 5:05 PM, Mike Kim <> wrote:
>> Hi all,
>> I am using Stata IC v.11 and trying to import data using:
>> insheet using mydata.csv, clear
>> However, due to 244 string limit, I cannot correctly import the following
>> example. I cannot use delimit(;) option because it changes the data
>> structure I intended. If I can split school variable using delimit("; ["),
>> it will work, but Stata does not allow this. Is there any way I can import
>> more than 244 string? Can Stata 12 handle large string variables? Thank
> you
>> in advance.
>> Mike.
>> clear
>> input str244 author str244 school
>> "Novicevic, MM; Humphreys, JH; Buckley, MR; Cagle, C; Roberts, F"
>> "[Buckley, MR] Univ Oklahoma, Michael F Price Coll Business, Norman, OK
>> 73019 USA; [Novicevic, MM; Roberts, F] Univ Mississippi, Sch Business Adm,
>> University, MS 38677 USA; [Humphreys, JH] Texas A&M Univ, Commerce, TX
> 75429
>> USA; [Cagle, C] Univ Mississippi, Sch Accountancy, University, MS 38677
> USA"
>> end
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index