I have string variable which contains “variable” like content as shown below.
str1="type=gene; loc=scaffold_12875; ID=FBgn0207418; name=Dvir\GJ20278;MD5=4c62b751ec045ac93306ce7c08d254f9; length=2088; release=r1.2; species=Dvir;"
I need to make variables out of the string such that the variables name and values goes like this
type="gene"
loc="scaffold_12875"
ID="FBgn0207418"
name="Dvir\GJ20278"
MD5="4c62b751ec045ac93306ce7c08d254f9"
length=2088
release="r1.2"
species="Dvir"
Thanks for the help in advance.
Don’t do this. You could, but don’t.
Instead make a dictionary whose keys are the names: