csvReader

@SinceKotools(project = Project.Csv, version = "2.0")
inline suspend fun <T : Any> csvReader(noinline configuration: Reader<T>.() -> Unit): List<T>

Returns the file's records as a given type T according to the given configuration or throws an IllegalStateException when:

  • the type T is not a public or internal data class

  • the configuration is invalid

  • the targeted file doesn't exist

  • the targeted file's header line contains an empty string.

@SinceKotools(project = Project.Csv, version = "2.0")
suspend fun <T : Any> csvReader(type: KClass<T>, configuration: Reader<T>.() -> Unit): List<T>

Returns the file's records as a given type according to the given configuration or throws an IllegalStateException when:

  • the type is not a public or internal data class

  • the configuration is invalid

  • the targeted file doesn't exist

  • the targeted file's header line contains an empty string.