I have a string that I've split almost to the level of what I need but not completely. My string looks like this to start:
str1 =
Out[135]: 'C:\\\\Users\\\\U321103\\\\OneDrive - IBERDROLA S.A\\VARIABILIDAD CLIMATICA\\\\VORTEX\\\\WIND8\\349039.SPAIN.ESTE.CARRASCOSA.Power.csv'
I have used a split technique to get it to here:
str2 = str1.split('WIND8\\')[1].split('.csv')[0]
Out[132]: '349039.SPAIN.ESTE.CARRASCOSA.Power'
However, I really need this final answer:
str3 = SPAIN.ESTE.Power
And, I'm not sure how to remove the string content before "SPAIN" and between "ESTE" and ".Power". The word "ESTE" will change - meaning that "ESTE" is a region of a country and will change each time the script is run. In the str1 variable, these subset strings will change each time the script is run: "349039", "SPAIN", "ESTE", "CARRASCOSA" so I think that the code needs to select by position between the periods "." in str2. Thank you for your help!