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]

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


From   "Kaulisch, Marc" <[email protected]>
To   <[email protected]>
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index