Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Reading/Appending SEVERAL files using INSHEET


From   "Sergiy Radyakin" <[email protected]>
To   [email protected]
Subject   Re: st: Reading/Appending SEVERAL files using INSHEET
Date   Fri, 24 Aug 2007 12:58:00 -0400

//without checking for syntax, etc. Just the logic:
insheet 1.txt
for i=2/500 {
  preserve
  insheet `i'.txt
  tempfile file_i
  save `file_i'
  restore
  append using `file_i'
}

check the syntax of each commands in the manual or help
The above way will be VERY inefficient for large files (as the data
from, say, the first file will be preserved/restored 499 times). So if
your files are large -- go in two loops, first convert the data with
insheet/save, then append one by one in the second loop.

-set memory- as necessary

Best regards, Sergiy


On 8/24/07, John A Karikari <[email protected]> wrote:
> Can someone please show me how to read and append SEVERAL (over 500!) files using "INSHEET"?
> Thanks,
>
> John Karikari
> GAO
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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