Вы можете просто установить разделитель на pandas
read, как в:
# Or .read_table
master_table = pd.read_csv("file.txt", delimter="|")
# Select just the rows where an arbitrary column is 1.
df1 = master_table[master_table["column_name"] == 1].copy()
Возможно, проще перебрать файл:
with open("file.txt", "r") as file:
for line in file:
if line[0] == 1: # Check any arbitrary condition
# Process the data