Search⌘ K

Raw Files

Explore how to read raw text files in Python using the open function and context management. Understand iterating over file lines and processing data separated by custom delimiters to prepare for further analysis.

Introduction to raw files #

Sometimes you get data in strange formats and you have to roll your own Python code to process the data. Fortunately, doing this is simple.

For this, we will assume that you have data in some type of text file. Each row of data corresponds to a row in your text file.

For example, you might have a file delimited ...