Convert RDA to CSV with a script

Posted on October 7, 2024 by Riccardo

Throw the following into rda2csv.r:

#!/usr/bin/env Rscript

argv <- commandArgs(TRUE)
inFile <- toString(argv[1])
print(paste("Reading:", inFile))

outFile <- gsub(".rda$", ".csv", inFile)
print(paste("Writing:", outFile))

inData <- get(load(inFile))
write.csv(inData, file=outFile)

Make it executable: chmod +x rda2csv.r

And run it on an RDA file: ./rda2csv.r path/to/file.rda

PinkLetter

It's one of the selected few I follow every week – Mateusz

Tired of RELEARNING webdev stuff?

  • A 100+ page book with the best links I curated over the years
  • An email once a week full of timeless software wisdom
  • Your recommended weekly dose of pink
  • Try before you buy? Check the archives.