This is what I want: if "select" found in a line -> delete that line. Delete also the lines afterwards until it finds "update" in a line, but I dont want this line to be deleted, just the line before.
update <something><something>
insert into <something><something>
insert into <something><something>
update <something><something>
That would be: clearing out all the lines with "select" and the lines that goes afterwards until it finds "update", but not deleting the line with "update".
I know I could simply do it like this,
sed '/^select/,/^update/d' myfile
but the problem is that I dont want it to delete the line with update, but the line just before when it finds it :s
Thank you,.. I dont know if this is possible. Sorry I was making a mess but there are several ways of getting the final result I want, and I just want to give to you the easiest way to have it done... thanks again