Statalist The Stata Listserver

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

Re: st: eliminating hyphens in a data cell

From   "Michael Blasnik" <>
To   <>
Subject   Re: st: eliminating hyphens in a data cell
Date   Tue, 15 May 2007 16:55:58 -0400

Given the example for the "all numbers" version of 061266276, it may actually be stored as a string. If that is the case, then destring is not what you want. Instead:

replace FEIN=subinstr(FEIN,"-","",.)

Michael Blasnik

----- Original Message ----- From: "Philipp Rehm" <>
To: <>
Sent: Tuesday, May 15, 2007 4:51 PM
Subject: Re: st: eliminating hyphens in a data cell

destring FEIN, ignore(-) replace

Ms. Marilyn Ibarra wrote:
I need to merge two data files by the variable FEIN (federal employer identification number). In one file the FEINS are all numbers (for example: 061266276). In the other file the FEINS have hyphens after the first two digits (for example: 06-1266276). Does anyone know how I can get them to look the same in both files so I can do a merge by the FEIN variable?

Thank you,
*   For searches and help try:

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