My question is about the split() function in Python. I use the space (" ") character as a separator. Some input are badly formatted and have 2 spaces instead of 1.
Is there an easy non-hackish way to tell split to ignore adjascent repeated spearators?
Example: Consider the file below:
Is there an easy non-hackish way to tell split to ignore adjascent repeated spearators?
Example: Consider the file below:
value1 value2
value3 value4
There are two spaces between value3 and value4. It messes up my script because split considers there's an empty element between the two. Isn't there a clean way to solve that?