Dear Researchers, I have several files as this example: Myfile_MyArea1_sample1.txt
i wish to split in "Myfile", "MyArea1", "sample1", and "txt", becasue i need to use "sample1" label. I try to use "strsplit" but I am able just to split as "Myfile_MyArea1_sample1" and "txt" OR "Myfile", "MyArea1", "sample1.txt" using strsplit(as.character("Myfile_MyArea1_sample1.txt"), ".", fixed = TRUE) strsplit(as.character("Myfile_MyArea1_sample1.txt"), "_", fixed = TRUE) Thanks in advance Gianni [[alternative HTML version deleted]] ______________________________________________ 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.