On Tue, Apr 27, 2004 at 12:26:32PM -0300, Beny Spira wrote:
> > Be careful however and try a copy of your file first or use
> >
> > perl -p -e 's: word :\n\\emph on\n word \n\\emph default\n:g' file.lyx >
> > file2.lyx
> >
> > Andre'
>
>
> Hi Andre
> Your script worked perfectly :-)
> Unfortunately, I do not understand anything about Perl and I would like
> to customize the script to do other kinds of changes. Could you
> recommend a site or book about making scripts in Perl?
> Thanks a lot
The perl man pages are pretty exhaustive. In fact, I don't think I've
ever used anything else to learn the bit of perl I know.
I could try to translate this:
perl
-p loop over all line in the file
-e use this expression
' needed as the argument contains e.g. spaces
s substitute
: some delimiter
<space>word<space> the thing to be replaced
: same delimiter
\n\\emph on\n word \n\\emph default\n the replacement
: same delimiter
g repeat if more than one instance
' closing quote