We're in need of a sed script to do the following:
Take an input file (see below for sample file)
Replace:
\begin{tabular}{|l|l|l|}
with
\begin{tabular}{|l|r|r|}
Delete all instances of the following patterns:
Pattern 1:
0&0&0\
\hline
Pattern 2:
\colorrow 0&0&0\
\hline
Pattern 3:
0&&\
\hline
Pattern 4:
\colorrow 0&&\
\hline
And save the result to another file. Sed only please (yes, you can do it with AWK, thank you)
If you know what you're doing this shouldn't take too long at all.
Sample file:
\def\colorrow{\rowcolor[gray]{0.50}}
\begin{tabular}{|l|l|l|}
\colorrow Email features&5&4\
\hline
Anonymous user support&5&5\
\hline
\colorrow Survey response&5&4\
\hline
Admin survey response report&8&5\
\hline
0&0&0\
\hline
\colorrow 0&0&0\
\hline
0&0&0\
\hline
\colorrow 0&0&0\
\hline
0&0&0\
\hline
\colorrow 0&0&0\
\hline
0&0&0\
\hline
\colorrow 0&0&0\
\hline
0&0&0\
\hline
\colorrow 0&0&0\
\hline
0&&\
\hline
\colorrow 0&&\
\hline
0&&\
\hline
\colorrow \textbf{Total}&123&\
\hline
\end{tabular}