I need a command that will search through a file and where it finds the marker %%BeginPageSetup then I want it to delete anything between the markers %%BeginFeature and %%EndFeature. There will be multiple occurrances of the Begin and End.
I have found a sed script that is supposed to do this but it is erroring, the script is below:
/^%%BeginPageSetup/,$ {
/^%%BeginFeature/,/^%%EndFeature/d
}
A sample of the file that I want this to work on is below:
%%Page: 1 1
%%BeginPageSetup
%%BeginFeature: *PageSize A4
%%EndFeature
%%BeginFeature: *InputSlot Upper
0 statusdict /setpapertray get exec
%%EndFeature
0 0.000 -3508.333 0 75.000 75.000 1.000 1.000 IP
%%EndPageSetup
After the command it should look like this:
%%Page: 1 1
%%BeginPageSetup
0 0.000 -3508.333 0 75.000 75.000 1.000 1.000 IP
%%EndPageSetup
Thanks and Regards
Mark.
I have found a sed script that is supposed to do this but it is erroring, the script is below:
/^%%BeginPageSetup/,$ {
/^%%BeginFeature/,/^%%EndFeature/d
}
A sample of the file that I want this to work on is below:
%%Page: 1 1
%%BeginPageSetup
%%BeginFeature: *PageSize A4
%%EndFeature
%%BeginFeature: *InputSlot Upper
0 statusdict /setpapertray get exec
%%EndFeature
0 0.000 -3508.333 0 75.000 75.000 1.000 1.000 IP
%%EndPageSetup
After the command it should look like this:
%%Page: 1 1
%%BeginPageSetup
0 0.000 -3508.333 0 75.000 75.000 1.000 1.000 IP
%%EndPageSetup
Thanks and Regards
Mark.