How can I read a csv file located in `assets` fold...
# multiplatform
l
How can I read a csv file located in
assets
folder from the
commonMain
module? i’m using
okio
api to read the file. it requires the full path of the file to be read but I don’t know how to provide the full path
Copy code
fun readCsvFile(filePath: String){
    val path = "words.txt".toPath() // where should I put this file?
    val csvContent = FileSystem.SYSTEM.read(path) {
        readUtf8()
    }
}
p
Perhaps asking in #squarelibraries might help
l
Tnx, I posted my question on that channel as well
l
I don't think assets are actually in the file system on Android. If I remember correctly, assets get zipped and included in the apk, and you reference it as a Stream of some sort.
231 Views