1. Line-Based Processing
  2. Advanced File Processing
  3. Case Study: Zip Code Lookup
  4. Details of Token-based Processing
    1. Structure of Files and Consuming input
      1. computer consider the 2D file as 1 line sequence of characters
      2. with special characters like \n or \\
      3. InputMismatchException
        1. wrong type of token
      4. Input Cursor
        1. When scanner obj first constructed: at the beginning
        2. move forward
        3. no support for backward
      5. Consuming input
        1. process
        2. it simply skips past any leading whitespace chars until next token
      6. Scanner keeps tracking the position of the input cursor. Even a method has passed, it still remembers.
      7. numbers.dat ---- Scanner obj
    2. token
      1. number, character...
    3. paths and directions
      1. File path
      2. file
      3. directory/folder
        1. current directory(a.k.a Working directory)
      4. call a file
        1. fully qualified
          1. absolute file path
          2. C:/data/numbers.dat
          3. forward slash /
        2. relative path
          1. data/numbers.dat
        3. waiting for users input file name
  5. File-Reading Basics
    1. Data, Data Everywhere
    2. Files and file objects
      1. file
      2. file extension
        1. data kind
        2. format
      3. access file=>construct internal object
    3. Reading a file from Scanner
      1. File f = new File("hamlet.txt");
      2. construct internal obj to access file data in computer
      3. import java.io.*;
        1. file i/o
      4. Scanner input = new Scanner(new File("hamlet.txt"))
      5. import java.util.*;
        1. scanner
      6. FileNotFoundException
        1. computer concerns it might not be found
        2. Checked Exception
      7. public static void main(...) throws FileNotFoundException{...}
      8. NoSuchElementException
        1. end of file
      9. Scanner need to have a type declaration