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: Merging data files in .txt format


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: Merging data files in .txt format
Date   Mon, 26 Nov 2012 10:44:33 +0000

You don't say why you want to merge (or -merge-) these datasets. For
almost all analyses, -append- will make much more sense.

I don't think there is an easy answer independent of the exact
contents of the files and your computer skills. A wild guess is that
the files don't themselves contain the quarter to which they refer, so
it may be easiest to read in the files one by one into Stata, make
sure that the quarter is copied to a variable within the dataset, and
then -append- to the cumulating dataset.

It's also possible that you can combine the files outside of Stata
using some scripting language and then read them into Stata just once.

Nick

On Sun, Nov 25, 2012 at 6:41 AM, David Ashcraft
<[email protected]> wrote:

> I have data files saved as .txt with titles bhcfQQYY where QQ is the quarter number and YY is the two digit year. I want to import and merge these files (48 in total) as one data set.When I am using -insheet-  importing all data as one variable (one column multiple rows) I digged it and found the problem as the data is using special character "^" for separating variables for each observation. Although I have solved this problem. But mow my problem is merging of data. Do I have to change each file and then merge or is there any other straight way to do it?

*
*   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