I think
. replace caseid = subinstr(caseid1," ","",.)
in both files should do the trick. see -help strfun- for details.
Uli
Ann E Fitzmaurice wrote:
> I have variables of the format in one file from dhs
> caseid1
> 1002 9
> 100211
> in a separate file I concatenate two variables and the format becomes
> caseid1
> 10029
> 100211
> what I would like to do is to eliminate the blanks from the variables in
> each file using trim but cannot get it to work, and then to split the
> variable caseid1 into two variables to remove the blank in the middle and
> then rejoin the two variables so that I can merge
>
> the one file has details relating to household, one line per household, the
> second file has details relating to the household member so want the
> household details to be applied to all household members
> can anyone help
>
> regards
>
> ann
>
> Ann E Fitzmaurice
> Medical Statistician
>
> University of Aberdeen
> Department of Obstetrics & Gynaecology
> Aberdeen Maternity Hospital
> Cornhill Road, Aberdeen. AB25 2ZL
>
> Tel: +44 (0) 1224 553876
> Fax: +44 (0) 1224 553708
> e-mail: [email protected]
> http://www.abdn.ac.uk/dugaldbairdcentre/
>
>
>
>
>
> *
> * 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/
--
[email protected]
+49 (030) 25491-361
*
* 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/