Data imports
In real-world applications, data may have to be consumed from multiple sources, and a lot of applications are still built to use flat files for data storage. In this section, we will work with a file containing data about students, and import that data into our course_registry
database. There are multiple formats that are commonly used to store data in a flat file. These formats use delimiters such as a comma, tab, or space, to separate one data item from another. The most popular formats are the CSV (comma separated values) and TSV (tab separated values) formats. We will work with a comma-separated list of student data that is stored in a flat file. Let's take a quick look at this data.
The following code snippet is contained in the students.csv
file:
George,Johnson,3225 Woodland Park Dr,Houston,TX,77087,george.johnson,6579e96f76baa00787a28653876c6127 Charles,Davis,3225 Woodland Park Dr,Houston,TX,77087,charles.davis,6579e96f76baa00787a28653876c6127 Edward,Moore,3225 Woodland...