Python Read File Multiple Columns Jun 27, 2023 • Ulysses Here’s how to read a file line by line with multiple columns. <pre lang="bash"> with open('file.txt') as file: for line in file: line = line.strip() columns = line.split() col1 = columns[0] col2 = columns[1] some_function(col1, col2)