Ygor and others, help combining 2 Awk scripts
I want to take this script:
awk 'BEGIN {b=""}
{ if (b > "" b=b "\n" $0; else b=$0}
/Page:/ {print b;b=""}
/EOF/ {print "LINE 1 HERE\n" b;b=""}
END {print b}' < $1
And this scripts:
awk 'BEGIN {b=""}
{ if (b > "" b=b "\n" $0; else b=$0}
/Begin/ {print b;b=""}
/EOF/ {print "LINE 4 HERE\n" b;b=""}
END {print b}' < $1
And figure out how to create one script to do it all.
I want to take this script:
awk 'BEGIN {b=""}
{ if (b > "" b=b "\n" $0; else b=$0}
/Page:/ {print b;b=""}
/EOF/ {print "LINE 1 HERE\n" b;b=""}
END {print b}' < $1
And this scripts:
awk 'BEGIN {b=""}
{ if (b > "" b=b "\n" $0; else b=$0}
/Begin/ {print b;b=""}
/EOF/ {print "LINE 4 HERE\n" b;b=""}
END {print b}' < $1
And figure out how to create one script to do it all.