I have a file such that each line consists of two strings separated by variable space, like below:
"Doe, Mary" "W 135"
How can this be parsed into pairs of strings, ["Doe, Mary", "W 135"]?
I have a file such that each line consists of two strings separated by variable space, like below:
"Doe, Mary" "W 135"
How can this be parsed into pairs of strings, ["Doe, Mary", "W 135"]?
 
    
    with open('file.txt') as f:
    pairs = csv.reader(f, delimiter=' ', skipinitialspace=True)
Now you can make a list of pairs, iterate over it in a for loop, whatever.
 
    
    