Comment

Comment by balnaphone

I suppose R might be a better choice...

    library(readr)
    library(dplyr)
    library(purrr)
    data <- read_csv("input.csv")
    chunk_size <- 500
    chunks <- split(data, ceiling(seq_along(1:nrow(data))/chunk_size))
    iwalk(chunks, ~write_csv(.x, sprintf("data-%04d.csv", .y)))
parent balnaphone 2 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton