From charlesreid1

Chapter 6: File Processing

Sections:

6.1 File reading basics

6.2 Token based processing

6.3 Line based processing

6.4 Advanced file processing

6.5 Case study: zip code lookup

Chapter 3 focused on a scanner for user input. Chapter 6 focuses on a scanner for file reading.

Many intro programming classes see this as a complicated topic, and Java doesn't make it easy. It's awkward, but it's manageable.

We will also explore exceptions relate to file processing.

(Python makes this a dream.)

with open('data.txt','r') as f:
    lines = f.readlines()

Done.

Flags