Closed abichat closed 4 years ago
Yes, you can use this format:
x <- c("26/09/2019 à 22:39 - Les messages envoyés dans cette discussion et les appels sont désormais protégés avec le chiffrement de bout en bout. Appuyez pour plus d'informations.",
"26/09/2019 à 22:39 - XXX: Salut :)",
"26/09/2019 à 22:39 - AB: Salut XXX :)")
rwhatsapp::rwa_read(x, format = "dd/MM/yyyy 'à' HH:mm")
#> # A tibble: 3 x 6
#> time author text source emoji emoji_name
#> <dttm> <fct> <chr> <chr> <lis> <list>
#> 1 2019-09-26 22:39:51 <NA> Les messages envoyés dans… text i… <NUL… <NULL>
#> 2 2019-09-26 22:39:51 XXX Salut :) text i… <NUL… <NULL>
#> 3 2019-09-26 22:39:51 AB Salut XXX :) text i… <NUL… <NULL>
Created on 2019-12-19 by the reprex package (v0.3.0)
Under the hood, stri_datetime_parse()
is used for date conversion (see ?stringi::stri_datetime_parse()
). I will leave this open to see if I can integrate it into the automatic format detection.
Actually, the issue came from the hh
instead of HH
😅
On my computer, it works with "dd/MM/yyyy à HH:mm"
Thanks!
This works now without defining a custom format. But the update didn't make it into the new CRAN version. Install with remotes::install_github("JBGruber/rwhatsapp")
and try again.
x <- c("26/09/2019 à 22:39 - Les messages envoyés dans cette discussion et les appels sont désormais protégés avec le chiffrement de bout en bout. Appuyez pour plus d'informations.",
"26/09/2019 à 22:39 - XXX: Salut :)",
"26/09/2019 à 22:39 - AB: Salut XXX :)")
rwhatsapp::rwa_read(x)
#> # A tibble: 3 x 6
#> time author text source emoji emoji_name
#> <dttm> <fct> <chr> <chr> <lis> <list>
#> 1 2019-09-26 22:39:38 <NA> Les messages envoyés dans… text i… <NUL… <NULL>
#> 2 2019-09-26 22:39:38 XXX Salut :) text i… <NUL… <NULL>
#> 3 2019-09-26 22:39:38 AB Salut XXX :) text i… <NUL… <NULL>
Created on 2019-12-22 by the reprex package (v0.3.0)
I encountered an issue to parse WhatsApp data with French locale.
This is what French data look like:
I tried to specified
format = "dd/MM/yyyy à hh:mm"
(and others) inrwa_read()
but it did not work... Do you have an idea of the correct format to use? If found, maybe it could be added to the default formats inrwa_parse_time()
.