csvReaderOrNull

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

Returns the file's records as a given type T according to the given configuration or returns null 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> csvReaderOrNull(type: KClass<T>, configuration: Reader<T>.() -> Unit): List<T>?

Returns the file's records as a given type according to the given configuration or returns null 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.