I would like to split a two different strings in python to the same length of 5. For example,
string1= '21007250.12000 -18047085.73200 1604.90200 59.10000 21007239.94800'
string2= '24784864.18300-318969464.50000 -1543.53600 34.48000 24784864.9700'
string1_final = ['21007250.12000','-18047085.73200','1604.90200','59.10000','21007239.94800']
string2_final = ['24784864.18300','-318969464.50000','-1543.53600','34.48000','24784864.9700']
Notice the separation of the white space and separating the two numbers while keeping the minus sign. I've tried using string2.split()
and string2.split('-')
, but it removes the minus. Any help would be greatly appreciated.