Statalist The Stata Listserver


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

RE: st: Appending files using stat transfer


From   "Rajesh Tharyan" <[email protected]>
To   <[email protected]>
Subject   RE: st: Appending files using stat transfer
Date   Tue, 26 Dec 2006 16:05:46 -0000

Hi,

Thanks Friedrich. Your question is quite legitimate. I run stata 8 on a
system with 1 GB mem (around 600m free mem as I have other programs running
as well) so sometimes when I have lots of large files to append and
manipulate, stata runs out of memory.

This was a problem I faced once before. I had 25 excel files with 250
company returns in each file. And I needed to put them all into one returns
file for my analysis (using other programs). That time I wrote a VBA program
to first split each excel file into 250 text files and then another program
in sas to read into and append the text files together and then after
cleaning up saved the file as sas file. And then used the usesas ado to read
into stata and save as a dta file.

Searching around for a better way to do it I came across the webpage I was
referring to earlier. So I thinking I would use stat transfer to convert and
append the files which might be more efficient.

Regards
rajesh


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Friedrich Huebler
Sent: 25 December 2006 16:52
To: [email protected]
Subject: Re: st: Appending files using stat transfer

Rajesh,

What are you trying to achieve? Do you want to use only one program
or do you want to use only Stat/Transfer? Are you familiar with
Stata's -shell- command? I would do the following:

1. Write a Stat/Transfer command file to convert the Excel files to
Stata format.
2. Write a Stata do-file that (a) calls the Stat/Transfer command
file with -shell- and (b) combines the files with -append-.
3. Run the Stata do-file to convert and combine the Excel files in
one go.

Another option is the Stata module -stcmd- (-ssc d stcmd-) to avoid
the use of Stat/Transfer command files.

Friedrich

--- Rajesh Tharyan <[email protected]> wrote:
> I have a number (3000) of excel files that i need to convert to dta
> files and i need to append them together. I can use the command
> line interface of stat transfer and convert them and then write a
> do file in stata to append them together. However i was wondering
> if the same can 
> be done in one go using stat trasfer. i.e to convert the files and 
> append them togther using the stat transfer command line interface.
> I read it someplace and had book marked the page unfortunately the 
> bookmark has disappeared!
> 
> regards
> rajesh


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
*
*   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