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

st: RE: Coping with strings longer than 80 variables


From   Roger Newson <[email protected]>
To   [email protected]
Subject   st: RE: Coping with strings longer than 80 variables
Date   Mon, 04 Aug 2003 10:29:16 +0100

At 10:01 04/08/03 +0100, Nick Cox wrote (in reply to Jolene Skordis:

As the version of Stata you are using won't allow
string variables longer than 80 characters, you
will need to use a version of Stata which does,
or fix this outside Stata.

I don't think there is another Stata solution, except
possibly by writing a program using -file-.

Some other possibilities are

* doing something in whatever generated this to split
or shorten your variables

* fixing this with Stat-Transfer or DBMS/Copy

* writing a script in Perl, Python or some other
scripting language

* fixing the problem in a text editor.
For what it's worth, I have written a package -intext-, downloadable from SSC, which reads text files into a Stata data set with as many string variables as necessary to represent the longest record. The user can then process these variables further. In Stata, you can find out more about this package by typing type

ssc desc intext

or, alternatively,

findit intext

if you want to view the help file before deciding whether you want to install it.

I hope this helps.

Roger


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