Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Extracting different portions of string values

From   "Florian Seliger" <>
Subject   st: Extracting different portions of string values
Date   Fri, 01 Oct 2010 10:41:04 +0200


we are searching for commands in order to extract different portions of string  values.

Our data with patent citations looks like this:

id  cit_1
1   EP696218-A -- WO9215370-A   SUND _SUND-Individual_
2   WO9425112-A -- GB298635-A
3   EP578126-A -- CH180906-A    AGE_OK
4   EP562128-A -- DE1684639-A
5   WO9318277-A -- DK137935-B
6   US4434855-A   SEC OF NAVY _USNA_

with 100,000 IDs and about 500 affected variables (cit_1, cit_2, cit_3...).
In this example, we only want to keep the second portion for the IDs 1-5, but the first portion for ID 6. We want to extract the first portion whenever there is only one citation number.

The data should thus look like this:

id  cit_1
1   WO9215370-A
2   GB298635-A
3   CH180906-A
4   DE1684639-A
5   DK137935-B
6   US4434855-A

Thank you very much.

Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren:
*   For searches and help try:

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