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   "Ashim Kapoor" <[email protected]>
To   [email protected]
Subject   Re: st: splitting a large file without reloading it in the memory.
Date   Sat, 27 Dec 2008 10:02:27 +0530

Thank you Fredrich.

Ashim.

On Fri, Dec 26, 2008 at 9:34 PM, Friedrich Huebler <[email protected]> wrote:
> 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 <[email protected]> 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/
>
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index