On 7/12/06, Wim R. Crols <[EMAIL PROTECTED]> wrote:
Jürgen Krämer wrote:
> Hi,
>
> Fabio Rotondo schrieb:
>
>> I have a text file with many lines made like this:
>>
>> [EMAIL PROTECTED]@[EMAIL PROTECTED]@
>>
>> And I'd like to have them splitted on "@" in newlines.
>>
>> I have tried:
>>
>> :%s/@/\n/g
>>
>> but it does not work.
>> What am I missing?
>>
>
> \n in the second part of a substitution denotes the NUL character which
> is used internally to represent end-of-line. To insert newlines you
> have to use \r:
>
>   :%s/@/\r/g
>
> Regards,
> Jürgen
>
>
Side-question: What line endings does \r insert? Or is this dependant on
fileformat?

\r, on the replace-part of s/search/seplace/,
inserts file-native linebreak. If shall be dependent on
fileformat, yes:
        :help s/\r

Yakov

Reply via email to