Mar-29-2023, 04:47 PM
Hello, I need some code to parse a variable name, so that merging it's data with another source later will occur correctly. I'm a beginner and am not quite sure where to start. I'm thinking some sort of if/else condition. I have it written out how it will probably read but am not sure how to actually execute it. Please advise as soon as possible if anyone can. Thank you in advance for your help!
Data treatment on File Export:
identify if there is a "-" symbol
if not then add a new variable replicate number = to 1
if present, then parse the sampleID, new sampleID without the -x and new variable isolate number = x
File export sampleID starts out looking like this:
694-1
694-2
694-3
694-4
etc...
But need the structure to look like this:
SampleID ISOLATE_NUMBER
694 1
694 2
694 3
694 4
etc...
Data treatment on File Export:
identify if there is a "-" symbol
if not then add a new variable replicate number = to 1
if present, then parse the sampleID, new sampleID without the -x and new variable isolate number = x
File export sampleID starts out looking like this:
694-1
694-2
694-3
694-4
etc...
But need the structure to look like this:
SampleID ISOLATE_NUMBER
694 1
694 2
694 3
694 4
etc...