Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: export list to .txt or excel file


From   Friedrich Huebler <fhuebler@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: export list to .txt or excel file
Date   Mon, 2 Aug 2010 11:26:50 -0400

Toby,

Try this.

local size1 : list sizeof onlytraded
local size2 : list sizeof onlynew
clear
local obs = max(`size1',`size2')
set obs `obs'
gen onlytraded = ""
gen onlynewn = ""
local i = 1
foreach o of local onlytraded {
  replace onlytraded = "`o'" in `i'
  local i = `i' + 1
}
local i = 1
foreach o of local onlynew {
  replace onlynew = "`o'" in `i'
  local i = `i' + 1
}
outsheet using data.txt

Friedrich

On Mon, Aug 2, 2010 at 10:19 AM, Hobst <tobias.friedli@access.uzh.ch> wrote:
> Hello Statalists
>
> I am working with the following code
>
> levelsof Traded_Model, local(traded) levelsof NewModel, local(new) local
> onlytraded : list traded - new local onlynew : list new - traded
>
> now i would like to export the lists "onlytraded" and "onlynew" to use it in
> excel (so i need a .txt, .csv, .xls or whatever)..
>
> Has somebody a suggestion how i could do that?
>
> Thank you in advance for your much appreciated help.
>
> Regards
> Toby
*
*   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   |   Site index