Top "Gsub" questions

Ruby, Lua, R and Awk methods for performing a global pattern substitution.

Remove entries from string vector containing specific characters in R

I've got two character vectors: x = {"a", "b", "c", "kt"} y = {"abs", "kot", "ccf", "okt", "kk", "y"} I need to …

r string character gsub grepl
R: combine several gsub() function in a pipe

To clean some messy data I would like to start using pipes %>%, but I fail to get the R …

r pipeline gsub
Escape spaces in a linux pathname with Ruby gsub

I am trying to escape the spaces in a Linux path. However, whenever I try to escape my backslash I …

ruby gsub
ruby gsub new line characters

I have a string with newline characters that I want to gsub out for white space. "hello I\r\nam …

ruby regex newline gsub
Remove dot(.) from specific columns using gsub and awk

I want to remove dot(.) only from the 4th and 5th columns of the table. input 1 10057 . A AC 1 10146 . AC. A 1 10177 . …

unix awk gsub
remove multiple patterns from text vector r

I want to remove multiple patterns from multiple character vectors. Currently I am going: a.vector <- gsub("@\\w+", "", …

r vector gsub mapply
Replace first occurrence of ":" but not second in R

In order to be able to process I'd like to replace the first occurrence of a : in a string (which …

regex r lapply gsub
Making gsub only replace entire words?

(I'm using R.) For a list of words that's called "goodwords.corpus", I am looping through the documents in a …

r gsub topic-modeling
R - Extract info after nth occurrence of a character from the right of string

I've seen many iterations of extracting w/ gsub but they mostly deal with extracting from left to right or after …

r regex string parsing gsub
R - gsub only digits

I would like to clean this vector and only retain the digits vec = c(" 4010 \"Filling in time budget diary\"", " 8888 \"Prob …

regex r gsub grepl