Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Mar 2006 18:14:17 -0500
From:      Parv <parv@pair.com>
To:        Gary Kline <kline@tao.thought.org>
Cc:        FreeBSD Mailing List <freebsd-questions@FreeBSD.ORG>
Subject:   Re: using perl to sub &sect; for \xa7.
Message-ID:  <20060317231417.GA3230@holestein.holy.cow>
In-Reply-To: <20060317072405.GA249@thought.org>
References:  <20060317072405.GA249@thought.org>

next in thread | previous in thread | raw e-mail | index | archive | help
in message <20060317072405.GA249@thought.org>,
wrote Gary Kline thusly...
>
> I've got several chapters with footnptes with that double-S
> "section" character.  In HTML, the code is &sect;   The thing I
> want to do is use perl to s/ \xa7/&sect;/g.....but don't know the
> keycombo to /find or designate tthe hex a7 byte.  Can anybody clue
> me in?

Use '-i' option for in place editing, '-p' to print the results to
the file, '-e' to specify the code to run ...

  perl -pi -e 's/\xa7/&sect;/g' file-1 file-2 file-3


... if you have quite many files use 'find' to find the HTML files,
say in directory named '/html/files' ...

  find /html/files -type f -name '*.html' -print0 \
  | xargs -0 perl -pi -e 's/\xa7/&sect;/g'


  - Parv

-- 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060317231417.GA3230>