Skip to content

Commit c648b5d

Browse files
authored
don't print header record in csv if requested
CSVFormat has a withSkipHeaderRecord method which could be used to not write header in result
1 parent ecdd7fa commit c648b5d

File tree

1 file changed

+3
-1
lines changed
  • core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io

1 file changed

+3
-1
lines changed

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/csv.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,9 @@ public fun AnyFrame.writeCSV(
332332
format: CSVFormat = CSVFormat.DEFAULT,
333333
) {
334334
format.print(writer).use { printer ->
335-
printer.printRecord(columnNames())
335+
if (format.getSkipHeaderRecord() == false) {
336+
printer.printRecord(columnNames())
337+
}
336338
forEach {
337339
val values = it.values.map {
338340
when (it) {

0 commit comments

Comments
 (0)