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

Re: st: RE: file write vs. display; trimming; string()


From   David Kantor <[email protected]>
To   [email protected]
Subject   Re: st: RE: file write vs. display; trimming; string()
Date   Thu, 29 Apr 2004 12:57:19 -0400

At 04:23 PM 4/29/2004 +0100, Nick Cox wrote:
Try something like

        tempfile foo
        tempname bar
        file open `bar' using `foo', write
        forval i = 1/10 {
                local val : di %5.0f `i'
                file write `bar' _n "`val'"
        }
        file close `bar'

Nick
[email protected]
[...]
Thanks very much, Nick. I suspected there would be a better solution, and that you would be the one who knew it..
-- David

David Kantor
Institute for Policy Studies
Johns Hopkins University
[email protected]
410-516-5404

*
* 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