Skip to content

neysap/CSV-File-Reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

CSV Parser: Custom Java CSVReader

This project is a robust CSV parser. It reads and processes CSV (Comma-Separated Values) files with special attention to formatting edge cases like:

  • Quoted fields with embedded commas
  • Escaped quotes inside fields
  • Inconsistent line endings (\n, \r\n)
  • Empty fields and empty rows
  • Ill-formed CSV data (triggers custom CSVFormatException)

Features

  • Implements CSVReader that reads rows using a custom CharacterReader
  • Parses fields according to standard CSV rules (RFC 4180-style)
  • Throws a custom CSVFormatException when CSV rules are violated
  • Includes comprehensive JUnit test coverage (CSVReaderTest.java)

Files Included

  • CSVReader.java – main parser class
  • CharacterReader.java – reads characters with position tracking
  • CSVFormatException.java – custom error for invalid CSV formats
  • CSVReaderTest.java – JUnit tests that handle normal and edge cases

How to Run Tests

Make sure you're in the root directory of your project and run:

# Using Maven:
mvn test

# Or in Eclipse:
Right-click → Run As → JUnit Test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages