Considering my text file would have the following pattern:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
xxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyyyyyyyyy zzzzzzzzzzzzzzzzzzzzzz aaaaaaaaaaaaaaaa bbbbbbbbbbb ports random name
Basically the output of docker ps command, written to a text file. What is the most effective way to convert this into a data frame or a readable format into python, to query the values. (i.e.) Given a name, get the matching container ID etc.
I tried
df = pd.read_csv("docker.txt",sep=" ")
but there are lapses, as the delimiter is not consistent.

sep='\s+'work for you?pd.read_csv("docker.txt", sep='\s{2,}')df = pd.read_fwf('docker.txt')