Artificial intelligent assistant

How do I use sed to remove all but certain punctuation globally? How can I remove all punctuation from a file using sed, with the exception of certain characters? Specifically, I want to keep these characters: @-_$% I am currently using this to remove all punctuation, but I am not sure how to modify it to keep those characters: cat input.txt | sed -e "s/[[:punct:]]\+//g" > output.txt Alternatively, how can I remove only certain punctuation? Like: .!?,'/\"()[]^*

**_sed_** approach:

Sample file contents:


.!?,'/\"()[]^* @-$%
.!?,'/\"()[]^* @ sdfsd %
as,,d//asd a?sd %% --@_ _asdasdad$
sdfsdf %''%!% 2 + 2 = (?)


* * *


sed '/[[:punct:]]*/{ s/[^[:alnum:][:space:]@_$%-]//g}' file


* * *

The output:


@-$%
@ sdfsd %
asdasd asd %% --@_ _asdasdad$
sdfsdf %%% 2 2

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy e9a8f72f730e21ea896b752671279312