Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Tokenize question


From   Nick Winter <[email protected]>
To   [email protected]
Subject   Re: st: Tokenize question
Date   Tue, 05 Feb 2008 12:27:25 -0500

I think you want the -split- command:

split name, parse(" - " "." "_")

--Nick Winter

Molly Lipscomb wrote:
Hello,

I'm trying to separate columns in a file which had multiple delimiters--they used , _ . and dashes as delimiters. Insheet's delimit option only seems to allow me to specify one delimiter, so I was trying to separate the columns using string commands, but several of the variables have different lengths, so string commands don't seem to be a feasible option. Tokenize seems to be the command to use here, but I must be misusing the command. My variable, name, has observations that look like:
12860000 - 2316_97_1303601_1302108.71.Yes.3459.
13410000 - 590_05_1200500_1300706.136.No.3059.
etc.
I would like to separate this into 8 different columns.
I tried many variations on the tokenize command, but I'm having no luck. Is there an easier way to do this?
Thanks so much for any advice you may have.
Best,
Molly

*
* 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/
--
--------------------------------------------------------------
Nicholas Winter                                 434.924.6994 t
Assistant Professor                             434.924.3359 f
Department of Politics                  [email protected] e
University of Virginia          faculty.virginia.edu/nwinter w
PO Box 400787, 100 Cabell Hall
Charlottesville, VA 22904

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