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

Re: st: Tabs in -listtex- header


From   Roger Newson <[email protected]>
To   [email protected]
Subject   Re: st: Tabs in -listtex- header
Date   Wed, 28 Jul 2004 14:14:28 +0100

At 17:45 27/07/2004, Friedrich Huebler wrote:
Dear List Members,

Apologies for taking up much bandwidth today. I use -listtex-
(available at SSC) to create tab-delimited text files for import into
a word processor. I would like to add tab-delimited headers that
match the data rows.

. sysuse auto, clear
. listtex make price mpg using "table.txt", head("Make Price MPG")
rstyle(tabdelim) replace

I have tried various methods to add tabs to the header but did not
succeed. Can this be done?
Yes. Use the -char()- function as follows:


. sysuse auto, clear
(1978 Automobile Data)

. local tab=char(9)

. listtex make price mpg using "table.txt", head("Make`tab'Price`tab'MPG") rstyle(tabdelim) replace

.

More helpful info about the -char()- function can be found in Nick Cox's Stata Tip on the subject (Cox, 2004).

I hope this helps.

Roger

References

Cox NJ. Stata Tip 6: inserting awkward characters in the plot. The Stata Journal 2004; 4(1): 95-96.



--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Email: [email protected]
Website: http://www.kcl-phs.org.uk/rogernewson

Opinions expressed are those of the author, not the institution.

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