Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: trim spaces in postcode


From   "Emma Slaymaker" <Emma.Slaymaker@lshtm.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: trim spaces in postcode
Date   Fri, 31 Mar 2006 14:19:42 +0100

Hi Maurizio,

I'm probably being too simplistic but doesn't this do the job:

gen str8 newvar=subinstr(oldvar," ","",.)

if oldvar is your current postcode variable and newvar is a new one.

Cheers,

Emma

>>> Maurizio.Gibin@southwarkpct.nhs.uk 31/03/06 13:55:54 >>>
Hi
I am trying to trim all the spaces in a code, in particular an english
unit postcode
but I still haven't found the correct way. I downloaded the ptseed
strip function but seems is not working.
Can anyone please help me? The database I am working on is quite
huge...
Thank you..
maurizio gibin
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html 
*   http://www.stata.com/support/statalist/faq 
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2020 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index