I have IDs in file A as follows:
In file B I have IDs as follows:
They are same ID, but in file A, a letter has been added to the beginning as well as a (-) and number following that are not needed.
I need to remove the p at the beginning of the ID variable in file A and remove the (-) and any following numbers after the (-) for ID variable in file A as well so I can merge the data from file A with file B using the ID variable from both files, but I cannot seem to figure out the right code. Any help is appreciated. Thank you.
Message was edited by: JHale
In file A the IDs must be character strings. What about file B? Are the IDs numeric or character variables???
If the data is exactly as you describe (that the IDs in file A always start with a 'p' or a 'p-'), then I'd probably recommend that you investigate the SCAN function. What remains to be determined is whether you will be doing a character to character comparison between the IDs in file A and file B or whether you will be doing a numeric to numeric comparison between the IDs.