Something like this should work: foo <- read.table("text2read.txt", colClasses=c("character", "NULL", "NULL"))$V1 foo <- gsub("i[0-9]-", "", foo) HTH, Andy