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 on April 23, and its replacement, statalist.org is already up and running.


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

AW: st: add column in -tabout- for symbols


From   "Kaulisch, Marc" <kaulisch@forschungsinfo.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   AW: st: add column in -tabout- for symbols
Date   Mon, 13 Jun 2011 15:36:06 +0200

Eric,

Thanks a lot for your suggestion and apologies for my inappropriate
change in the second table.

In my concrete example I have several spaces in v1 and so I need a
different approach, but the following does the trick for me:
preserve
insheet using test_tabout.txt, nonames clear
gen v11 = ""
replace v11 = "N" if v1 == "N"
replace v11 = "%" if regexm(v1, "%")
replace v1 =  subinstr(v1, " %", "", 1)
replace v1 = subinstr(v1, "N", "", 1) if v11 == "N"
order v1 v11

outsheet using "test_tabout_updated.txt", ///
	replace nonames noquote
restore 

Thanks again, (and if someone does know a better solution for -tabout- I
would happy to integrate that ;-) )

Marc

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