Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: insheet, European format, comma


From   Ulrich Kohler <[email protected]>
To   [email protected]
Subject   Re: st: insheet, European format, comma
Date   Tue, 30 Aug 2005 14:32:42 +0200

Seb Buechte wrote:
> >    Common problem for european users. The easier way to avoid it: using
> > Excel, apply function "replace" comma by point (replace all) then
> > save as text file (tab delimited). open stata and import your .txt
> > file will work fine.
>
> Why is that easier?

Among research groups this depends on _who_ has to do it ;-)

Probably StataCorp might add a comma-option to -destring-, hence: 

-------------------------------------------destring.ado 
program destring
  syntax [varlist], [Generate(string) replace] [force] [float] /*
                */ [Ignore(string)] [percent] [comma]
 
  if "`comma'" ~= "" {
	foreach var of local varlist {
		replace `var' = subinstr(`var',",",".",.)
	}
  }

<go on as in destring.ado>
-----------------------------------------------------------

As End User you might also copy destring.ado to [personal]/destring2.ado and 
make the changes there.

Uli

-- 
[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/



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