I have a text file, which is several hundred rows long. I am trying to remove all of the [edit:add] punctuation characters from it except the "/" characters. I am currently using the strip function in the qdap package.
Here is a sample data set:
htxt <- c("{rtf1ansiansicpg1252cocoartf1038cocoasubrtf360/",
"{fonttblf0fswissfcharset0 helvetica",
"margl1440margr1440vieww9000viewh8400viewkind0")
Here is the code:
strip(htxt, char.keep = "/", digit.remove = F, apostrophe.remove = TRUE, lower.case = TRUE)
The only problem with this beautiful function is that it removes the "/" characters. If I try to remove all characters except the "{" character it works:
strip(htxt, char.keep = "{", digit.remove = F, apostrophe.remove = TRUE, lower.case = TRUE)
Has anyone experienced the same problem?