Thank you Dieter and Rolf, I have solved the slash Problem, but I still struggling with the output files.
I have tried this by(AlexETF,AlexETF$Industry,function(a) {filename = paste("C:/ab/",gsub(" ","",a$Industry[1]),".txt",sep="") print(filename) write.table(a,file=filename,col.names = FALSE) } ) and this by(AlexETF,AlexETF$Industry,function(a) {filename = paste("C:/ab/",gsub(" ","",a$Industry[1]),".txt",sep="") print(filename) write(as.character(a),file=filename) } ) I want in each file just the ticker with out any quotations mark. CMM FMCN IPG MWW Thanks in advance, Peter -- View this message in context: http://n4.nabble.com/Data-Manipulation-tp1018249p1073567.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.