Apologies for any confusion. In the long text from row 1,
'Herpes Simplex Virus (HSV) 1/2 (IgG) Type Antibody, CSF Lymphocytic Choriomeningitis (LCM) Virus (IgG, IgM) Antibody, IFA, CSF Measles (Rubeola) (IgG, IgM) Antibody Panel, IFA, CSF Mumps Antibody Panel, IFA, CSF Varicella-Zoster Virus (VZV) Antibodies (Total, IgM), ACIF/IFA, CSF West Nile Virus (WNV) Antibodies (IgG, IgM), CSF'
I would like to use 'IgG', 'IgM', or 'IgG, IgM' as labels. If a pathogen appears before the label, I will add an underscore between the pathogen and the antibody type to create a new pathogen_antibody label. For example:
Herpes Simplex Virus (HSV) appears before 'IgG', so the first label will be HSV_IgG .
The second label is 'IgG, IgM' and appears after Measles, so the second label is Measles_IgG, IgM . (BTW, either Meals or Rebeola is fine cause they are in the same group)
Mumps does not have a label associated with it, so it will not be included in the results.
Ideally, I would like each result to be listed in a separate row. However, if that's not possible, listing them all in one row would be acceptable.
Also, as the text shows, not all pathogen names have abbreviations or are enclosed in parentheses. Using the full names for the results would be more accurate. Additionally, I noticed that 'CSF' is the last word associated with each pathogen. To improve the search, it might be helpful to use 'CSF' as a separator to distinguish the next pathogen.
data Want_Final;
length Sub_Analyte $1000;
infile datalines delimiter='#';
input Sub_Analyte;
datalines;
Herpes Simplex_IgG# Lymphocytic Choriomeningitis_IgG,IgM# Measles_IgG,IgM# Varicella_IgM# West Nile Virus_IgG,IgM# Herpes Simplex_IgG#
;
... View more