bhakum3
September 24, 2020, 1:25pm
1
I have an input field which it will have value like this --> {ABCD}{U23}.
Need to remove {} before hitting my impala query should be like this --> ABCDU23. I tried using gsub(), str_replace(), rm_curly() but no luck. Anyone came across this fix can help me.
Thanks
Leon
September 24, 2020, 2:02pm
2
Try this:
stringr::str_replace_all("{ABCD}{U23}", "\\{|\\}", "")
?
bhakum3
September 24, 2020, 2:51pm
3
I tried the below one but failed to get the output.
stringr::str_replace_all(input$fieldname, "\{|\}", "")
Leon
September 24, 2020, 3:09pm
4
Try
library("tidyverse")
input
input <- input %>%
mutate(fieldname = fieldname %>% str_replace_all("\{|\}", ""))
input
?
bhakum3
September 24, 2020, 7:01pm
5
The above code is not working.
Is it below one work?
gsub("[{}]", "", input$fieldname)
system
Closed
November 17, 2020, 11:02pm
6
This topic was automatically closed 54 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.