Hi I have a SQL file i wanted to remove case statements which are present in a single line as well as case statements which are present in multiple lines. For example, my input file is:Select a,b,c,CASE when e in (1,0,2) then Y END as ef,g,h,case when i in (5,6,7,9.,10) then NEND as iFROM ABCDIn my output it should beSelect a,b,c,e as ef,g,h,i as iFROM ABCDI'm using the sed commandsed -i 's/\bCASE\b.*\bEND\b/${FIELD}/' $FILEbut this is working only for case and end statement which are on single line I want to make it work for case and end statements which are multiple lines too.
Remove and replace between two specific strings using sed command
sed