Terminé

sed script, multi-line replace

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}

Compétences : Linux, Script Install, Administration Système

en voir plus : sed replace, sed, sed replace line, sed script, multi sed, sed delete line, sed multi replace, sed replace yes, sed multi, script replace, sed multi line, script replace sed, sed replace multi line, replace, line-following, awk, email support response, anonymous install, support line, system sed, yes response, replace file file, support script, multi file, multi user email system

Concernant l'employeur :
( 12 commentaires ) Portland, United States

Nº du projet : #1045884

Décerné à:

slynux

Hey I have written the sed script for you. Please see the PM. If you need any improvements message me.

%selectedBids___i_sum_sub_7% %project_currencyDetails_sign_sub_8% USD en 0 jours
(4 Commentaires)
3.8

8 freelance font une offre moyenne de $32 pour ce travail

vili1977

I can help you.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(54 Commentaires)
5.0
srinichal

I can deliver this straight forward

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(17 Commentaires)
5.0
ClusterStudio

Hello. I'm experienced linux administrator and will make this sed script in minutes. I am ready to begin as soon as you accept the project.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 0 jours
(26 Commentaires)
4.4
freelance4hire80

Hi, please check your PMB. Thanks

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 0 jours
(7 Commentaires)
3.5
gyaseen

please check your PM Box

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(0 Commentaires)
0.0
ankel

Easy job for me. Please see PMB.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 0 jours
(0 Commentaires)
0.0
bojomojo

I can do this with PERL

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(0 Commentaires)
0.0