Bookmark and Share

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: Using infile with varying lines() per observation


From   Sergiy Radyakin <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Using infile with varying lines() per observation
Date   Thu, 25 Jul 2013 19:05:25 -0400

just to confirm, is it fixed? or is it space-separated? or tab separated?
is only the second column affected or other columns may have the same problem?
Sergiy

On Thu, Jul 25, 2013 at 5:35 PM, Kevin McConeghy
<[email protected]> wrote:
> Hello users,
>
> It may be that STATA can't do this, I couldn't seem to find any
> reference to it online or the listserve. I am trying to import data
> that is in fixed format text files like so:
>
> id col1 col2 col3
> 1  A     B    C
>            B
>
> 2 A      B    C
>
> 3 A      B    C
>            B
>            B
>
> The key is Col2 which contains essentially free text I was hoping to
> import as a string. The problem is that the text varies in length per
> observation and therefore each observation occupies varying numbers of
> lines.
>
> Infile allows you specify more than one line per obs through the
> lines() option, but doesn't seem to let you vary this number. Is there
> a user-written program for this? or some other way to address the
> problem?
>
> I think SAS can do this, but I prefer staying in STATA if I can.
>
> Kevin
> --
> Kevin McConeghy, PharmD, BCPS
> 833 S Wood St, Chicago, IL 60612
> College of Pharmacy, Dept. of Pharmacy Practice
> University of Illinois at Chicago
> (312)-413-1422, [email protected]
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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