in reply to Search & Replace Revisited

Use s/// to replace any characters except those you want.

perl -pi.bak -e 's#[^\d$/]#,#g' file1.txt

Yeah, \D would have been simpler than [^\d$/], but then you'd also get the input record seperator assuming it hadn't been set to a number.

Replies are listed 'Best First'.
(jcwren) RE: Re: Search & Replace Revisited
by jcwren (Prior) on Oct 06, 2000 at 05:14 UTC
    The ^@ is a null, or \0.
    perl -pi.bak -e 's#\0#,#g' file1.txt
    --Chris

    e-mail jcwren