Files

  1. File types: Text vs Binary
  2. Open vs Read
  3. Binary files: Images
  4. Reading an Excel file
  5. Open and read file (easy but not recommended)
  6. Open and read file using with (recommended)
  7. Read file remove newlines
  8. Filename on the command line
  9. Filehandle with return
  10. Read all the lines into a list
  11. Read all the characters into a string (slurp)
  12. Not existing file
  13. Open file exception handling
  14. Open many files - exception handling
  15. Writing to file
  16. Append to file
  17. Binary mode
  18. Does file exist? Is it a file?
  19. Direct access of a line in a file
  20. Exercise: count numbers
  21. Exercise: strip newlines
  22. Exercise: color selector
  23. Exercise: ROT13
  24. Exercise: Combine lists
  25. Solution: count numbers
  26. Solution: strip newlines
  27. Solution: color selector
  28. Solution: Combine lists
  29. Filehandle using with and not using it