in reply to Replacing ^L with \n

warning, non perl solution below!

Because youre using the expression "some DOS text" I will (possibly mistakenly) assume that you are using a *nix. In which case, you can use perl but its sort of overkill. I would use sed(1).

[alex@creamy]$ sed 's:^L:\n:g' filename > filename.out
of course, to create a ^L you actually need to do a ^V^L or your shell will assume you really mean ^L. Also, \n is native to the gnu sed, and may not work in BSD or ATT *nix's.

brother dep.

--
Laziness, Impatience, Hubris, and Generosity.

Replies are listed 'Best First'.
Re: Re: Replacing ^L with \n
by auzten (Initiate) on Apr 05, 2001 at 23:36 UTC
    That ended up replacing ^L with the actual character n, not a carriage return.

    I tried this and it worked:

    perl -pi -e 's/^L/\n/g' file.txt

    Maybe I should learn something about regular expressions?

    Muchos Gracias
    -auzten