splitCSV to file #2193
-
I am using splitCSV() to split a large CSV file chunks of 1000 lines each with headers. Is there a workaround? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you aren't actually using the values of the CSV in nextflow, you can just use
|
Beta Was this translation helpful? Give feedback.
If you aren't actually using the values of the CSV in nextflow, you can just use
splitText
, which does have a file option.splitCSV
doesn't have a file parameter because it doesn't produce a file, it produces a channel filled with lists. If you can't use the above option because you are using the CSV contents within nextflow, you can do something likecsvChannel.map { it.join(',') }.collectFile(name: "output_filename.csv")
, which joins each list together into a string, then joins each row in the channel together into a file.