Skip to content

Instantly share code, notes, and snippets.

@fixxer
Created April 3, 2014 14:25
Show Gist options
  • Save fixxer/9955319 to your computer and use it in GitHub Desktop.
Save fixxer/9955319 to your computer and use it in GitHub Desktop.
input = read.csv("input.csv", sep=";", colClasses=rep("character", 12), col.names=rep("c", 12))
output = result[,c("c.1", "c.7", "c")] # take second, eighth and first columns
output["new"] <- "" # append new empty column
colnames(output) <- c("Column 1", "Column 2", "Column 3", "Column 4") # rename columns
write.table(output, "output.csv", sep=";", quote=FALSE, row.names=FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment