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 <dkantor@jhu.edu>
To   statalist@hsphsun2.harvard.edu
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
n.j.cox@durham.ac.uk
[...]
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
dkantor@jhu.edu
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index