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

Re: st: Listtex: headlines and append


From   Roger Newson <roger.newson@kcl.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Listtex: headlines and append
Date   Sun, 09 Oct 2005 19:27:50 +0100

Hello again

Another instant fix. If Herve wants to use -listtex- to create files without extensions, then one way (at least under Windows) is to specify a filename ending in a period, without an extension, as in

listtex name using table_countries. if sample39_absence==1, rstyle(tabdelim) headlines("sample39_absence") replace

This should create a file named table_countries (without an extension), at least under Windows. The next update of -listtex- may add a period to any non-empty -using- or -appendto()- filename not containing a period, at least under Windows. (I am thinking aloud here about possible solutions.)

Best wishes (and thanks again to Herve for notifying me about this bug)

Roger


At 17:37 09/10/2005, I wrote:

At 07:40 08/10/2005, Herve wrote:
Dear All:

I have two questions concerning -listtex- (downloadable from ssc).

I want to export two variations of a list of countries.

Question 1: Headlines

With the following command, I would like to get a column title: "sample39_absence" above the first list of countries.

listtex name using table_countries if sample39_absence==1, rstyle(tabdelim) headlines("sample39_absence") replace

I get the countries but no title.

Question 2: Append

I would like to append the second list of countries below the first one. I use the following command:

listtex name using table_countries if sample32_absence==1, rstyle(tabdelim) headlines("sample32_absence") appendto(table_countries)

I get the following error message:

file table_countries.raw already exists
Thanks to Herve to alerting me about this bug in -listtex-. This bug is activated when the user specifies a -using- file or an -appendto()- file without an extension, and can be fixed by specifying a -using- or -appendto()- file with an extension, as in

listtex name using table_countries.txt if sample39_absence==1, rstyle(tabdelim) headlines("sample39_absence") replace

or

listtex name using table_countries.txt if sample32_absence==1, rstyle(tabdelim) headlines("sample32_absence") appendto(table_countries.txt)

Adding a filename extension is an immediate fix. The reason for this bug is that -listtex- uses both -outfile- and -file-. Given a filename without an extension, -file- assumes a file without an extension, and -outfile- adds the extension .raw, as in table_countries.raw. I am currently working on a long term policy for -listtex- regarding filenames without extensions.

I hope this helps. (Let me know if it doesn't.)

Best wishes

Roger

--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
Division of Asthma, Allergy and Lung Biology
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: roger.newson@kcl.ac.uk
Website: http://phs.kcl.ac.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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index