I am trying to to search through a string to find a match and then display everything after the searched text until a comma? Here is an example and where I am stuck.
my_str = '1=perl,56=python,98=java,12=vbs cript'
strx = my_str.find("56 =")
So, I have my start point now which would be = "strx" but I need the data that is actually after the "56=". I am interested in the "python" and would like to output that. It won't work to take the 6 characters after the 56= because that value may be a different length, as a matter of fact will most likely change from string to string. I will be using this procedure to loop through a list that is created from a file that I am opening.
Any thoughts on this would be much appreciated.
Am I approaching this wrong?
my_str = '1=perl,56=python,98=java,12=vbs cript'
strx = my_str.find("56 =")
So, I have my start point now which would be = "strx" but I need the data that is actually after the "56=". I am interested in the "python" and would like to output that. It won't work to take the 6 characters after the 56= because that value may be a different length, as a matter of fact will most likely change from string to string. I will be using this procedure to loop through a list that is created from a file that I am opening.
Any thoughts on this would be much appreciated.
Am I approaching this wrong?
Comment