I need to find a certain pattern in notepad and delete all of it. So the lines might be something like:
1,2,c(0,9,3),5,7,9,2
2,3,c(4,7,2),5,4,3,1
and I want to get back:
1,2,5,7,9,2
2,3,5,4,3,1
how should I do this? Thanks
CodePudding user response:
- Open the replace dialog
- Select the radio button for regular expressions
- Use the search pattern
^(.*?),c\(.*?\)(.*?$)
- Replace it by
$1$2
This should match your lines and the both capture groups capture the parts you want to keep. Then we replace by the content of the both capture groups $1$2