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

Re: st: Tokenize question

From   Nick Winter <>
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:

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

* For searches and help try:
Nicholas Winter                                 434.924.6994 t
Assistant Professor                             434.924.3359 f
Department of Politics         e
University of Virginia w
PO Box 400787, 100 Cabell Hall
Charlottesville, VA 22904

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index