Hi I am trying to remove part of string using sed command but looks like all options that i came across stack overflow doesn't seem to work.
sub-285345_task-WM_dir-28_epi.nii
sub-285345_task-LANGUAGE_dir-11_epi.nii.gz
I want to remove _task-***
part of it. I want to remove task-**, key value pair.
sed s/_task-.*//g
This removes even dir-** after task. sub-285345_epi.nii.gz
How can i remove only task key value pair?