if(!require(rcdk)){install.packages("rcdk");library(rcdk)}
#[1]
ifname<-"DataChemicalMatrix.csv"
data<-read.csv(ifname,stringsAsFactors=FALSE)
mols<-paste0("mol/",data$KNApSAcK_CID,".mol")
mols
#[2]
sdfset<-load.molecules(mols)
smilesdata<-as.list(NULL)
for(i in 1:length(mols)){
  smilesdata[[i]]<-get.smiles(sdfset[[i]],flavor=smiles.flavors(c('CxSmiles')),smigen=NULL)
}
msmiles<-unlist(smilesdata)
SmilesData<-data.frame(data$Name,data$KNApSAcK_CID,data$StartingMaterial,msmiles)
write.csv(SmilesData,file="DataSmiles.csv")