On 03/10/2007, david <[EMAIL PROTECTED]> wrote:
>
> I want to edit a multi line file as if it were all one line
>
> In other words, treat \n like any other character, and specifically
> doing global find and replace.
>
> I know there are various hex editors, but they are all pretty clunky as
> far as I can see, and none seem to be able to do that from command line.
>
> Is there a shell script way to do it?


Can you be more specific of what you are trying to achieve?

A brief look at sed(1) (GNU sed 4.1.5 on Debian Etch) shows that "\n" in
regular expressions will be treated as a newline, and in perl you can add
"//s" modifier to make perl treat strings as single line (see perlre(1)).

Also it might be worth digging the excellent vim.org web site, I wouldn't be
surprised to find something there that will tell you how to do that using
VIM.

--Amos
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to