You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we have asymmetric interface between read and write tabular data : Read :
File(pathTo("simple_data.xlsx")).inputStream().use {
val columns =object:RetableColumns() {
valFIRST_NAME= string("first_name", index =2)
valLAST_NAME= string("last_name", index =1)
valAGE= int("age", index =3)
}
val retable =Retable
.csv(columns)
.read(it)
}
Write :
val columns =object:RetableColumns() {
valFIRST_NAME= string("first_name", index =2)
valLAST_NAME= string("last_name", index =1)
valAGE= int("age", index =3)
}
Retable(columns)
.data(
listOf(
Person("John", "Doe", 23),
Person("Jenny", "Boe", 25)
)
) {
mapOf(
FIRST_NAME to it.firstName,
LAST_NAME to it.lastName,
AGE to it.age
)
}
.write(Retable.excel(columns) to File(pathTo("export_data_cols.xlsx")).outputStream())
It's would better to have same code to read and write a file until we call read or write method.
The text was updated successfully, but these errors were encountered:
Currently we have asymmetric interface between read and write tabular data :
Read :
Write :
It's would better to have same code to read and write a file until we call read or write method.
The text was updated successfully, but these errors were encountered: