0

The whole should be applied, but only one cell is applied.

There are 1234 cells in total. This should all apply but I only apply to one space.

I do not know the meaning of the code, so I can not change it.

How do I get all 1234? Please advise me.

yes<-read.csv(file.choose(),encoding = 'UTF-8',stringsAsFactors = F)
bb<-yes$text

How to divide text (string) by a certain character using r

Messages = strsplit(bb, "\\d{1,2}/\\d{1,2}/\\d{4}")[[1]]
m <- gregexpr("\\d{1,2}/\\d{1,2}/\\d{4}", bb)
Dates = regmatches(bb, m)[[1]] 
if(length(Messages) > length(Dates)) { Messages = Messages[-1] }
c<-as.data.frame(cbind(Dates, Messages))
write.csv(c,"tqtqtq.csv")
Jaap
  • 81,064
  • 34
  • 182
  • 193
koko
  • 177
  • 2
  • 11
  • 2
    What is your data? – Aleksandr Oct 08 '17 at 09:39
  • 3
    If you do not understand the answer on a [previous question you asked](https://stackoverflow.com/q/46622949/2204410) you should formulate this question such that people understand what didn't work. Therefore, please conform to the guidelines on [how to ask a good question](http://stackoverflow.com/help/how-to-ask) and how to give a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610). This will make it much easier for others to help you. – Jaap Oct 08 '17 at 09:54
  • @AleksandrVoitov [data](https://stackoverflow.com/questions/46622949/how-to-divide-text-string-by-a-certain-character-using-r) One cell has my data (my data in the link). There are 1234 cells in total called my data. – koko Oct 08 '17 at 11:02

0 Answers0