Run Unix Shell Commands in R

Hi, and welcome. Take a look at the system2 function in {base}

help(system2

for the tools to apply available OS programs, including terminal commands.

If's preferable, however, to do the same operation in R when an equivalent is available. In your example, the stringr package combined with the magrittr package will work depending on the nature of your input file. Assuming origFile.csv with the offending string in a single column, you would first read it in as a dataframe, and then delete your string.

inputFile <- origFile %>% mutate(tab_column = str_replace(tab_column, "\\|\\t", "")

It's always helpful when posing a question to include a reproducible example, called a reprex. Thanks!