I have a string like '"F01" le code le "F16"' I want to parse this string to get a new string contains "F01", "F02, "F03" ... until "F16".
I tired to parse the string by quotes and hope to loop through the first code till the last code. And then tried to increment the code via chr() and ord(). But can't seem to figure it out.
import re
s = '"F01" le code le "F16"'
s_q = re.findall('"([^"]*)"', s)
first_code = s_q[0]
last_code = s_q[1]
ch_for_increment = s_q[0][-1:]
ch_for_the_rest = s_q[0][:-1]
print(ch_for_the_rest + chr(ord(ch) + 1))
F01 F02 F03 F04 F05 F06 F07 F08 F09 F10 F11 F12 F13 F14 F15 F16or"F01" "F02" "F03" "F04" "F05" "F06" "F07" "F08" "F09" "F10" "F11" "F12" "F13" "F14" "F15" "F16"