Statalist


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

Re: st: splitting a large file without reloading it in the memory.


From   "Friedrich Huebler" <fhuebler@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: splitting a large file without reloading it in the memory.
Date   Fri, 26 Dec 2008 11:04:07 -0500

Ashim,

Here is an example with the auto data.

sysuse auto
levelsof rep78, local(rep)
foreach r of local rep {
  outsheet using data`r' if rep78==`r'
}

Friedrich

On Fri, Dec 26, 2008 at 12:05 AM, Ashim Kapoor <ashimkapoor@gmail.com> wrote:
> Hello everyone,
>
> Here is what I do now : ---
>
> foreach x in apple orange mango {
> clear
> use hugefruitbasket <==== HUGE FILE
> keep if symbol=="`x'"
> save `x', replace
>
> }
>
> -------------------------------------------
>
> So essentially I load a huge file in memory, which makes my computer
> hang for a moment, then I keep a portion of it, give it a name and
> save it.
>
> ------------------------------------------
>
> What I want to do is : --- Load a big file ONCE, then do something like
> save `x' if symbol==`x'
> or outsheet  if symbol==`x'
> so that I can save parts of the  file without reloading / messing the
> original file.
>
> I think this is very useful for me.
>
> Is there a clever command to do this ?
>
> Thank you,
> Ashim.
*
*   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