1. Learn
  2. /
  3. Courses
  4. /
  5. Importing Data in Java

Connected

Exercise

Implementing data validation

After successfully reading the market data files, you've noticed that some files might be empty or missing important columns. Before performing any complex analysis, you need to implement basic validation checks to ensure the data files are usable. This will help prevent errors later in your data processing pipeline.

The Files, Path, Paths, and List classes have been imported for you.

Instructions

100 XP
  • Read all lines from the file into a list.
  • Check if the file is empty.
  • Verify the header contains the expected column names: Date and Ticker.