I want to copy a string which is located at third place in a text file.
Though I can count the character and copy the string based on their character index, I am afraid for some of the files this strings might have more or less number of characters.
For example, in the below line I have third string as 239.943
; for some other file it could also be 1022.345
or 98.234
.
1 51 239.943 .2081 .0137 .2016 .0017
Is there any way to identify and copy the third string i.e., 239.943
irrespective of its character length in python?