hi!
i have a file consisting of the following lines:
(BTW, [] = space)
.
.
.
12[]ME_T1mapping_flip30[]bshort[]f
13[]DCE_whole_brain[]bshort[]f
13[]DCE_3D[]bshort[]f
.
.
.
the list of scans starts at 1 and goes on sometimes up to 60 scans. i would like to change only the lines that contain 'whole' to this:
13[]DCE_whole_brain[]spm[]f
but the scans containing 'whole' are not always on line 13, and they do not always say DCE_whole_brain, they change. but they always include the word 'whole'.
my question is can you scan the file for lines that contain the string 'whole' and change only the 'bshort' to 'spm', while leaving the rest of the file intact?
i've used 'sed' to get up to the point shown above, but now i'm stuck on how to find only parts of a string, change them and leave the rest of the file alone.
any help would be greatly appreciated. thanks!