Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Alberto R Osella <arosella@irccsdebellis.it> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | st: Substring problem |
Date | Mon, 04 Mar 2013 14:38:23 +0100 |
My data look like this. A B C 1. | Latte di vacca parzial. scremato 200 g (92 kcal) 2. | Caffe' in tazza 30 g (0 kcal)3. | Sogliola 150 g (124 kcal)
4. | Olio di oliva extra vergine 15 g (134 kcal) 5. | Cicoria di campo 200 g (20 kcal)These are three strinf variables coming from a software. I need to transform the last two string variables into numeric ones but
I need only a substring of them ( not 200 g but 200, not (92 kcal) but 92. I've tried but I was not able to find a solution. I'm using Stata 12.1 on W7. Can anyone to help me? Thanks in advance -- Alberto R. Osella, MD, PhD Laboratorio di Epidemiologia e Biostatistica IRCCS Saverio de Bellis Via Turi, 27 70013 Castellana Grotte (BA) Italia Tel: +39 0804994655 Fax: +39 0804994650 e-mail: arosella@irccsdebellis.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/