[TriLUG] Help with search and replace in vi using regexp

Brian Blater brb.lists at gmail.com
Mon Jul 14 14:58:55 EDT 2008


On Mon, Jul 14, 2008 at 2:31 PM, Robert Dale <robdale at gmail.com> wrote:
> I imagine you have more than one m3u file, in which case I would use
> sed (or perl, or other non-interactive editor)...
>
> sed -i '/^#EXT.*/d' *.m3u
> sed -i 's/.*\/\(.*\)$/\1/g' *.m3u
>
> Also, I don't think vi will actually delete a line with %s, you'll
> have a blank line there.
>
> --
> Robert Dale

Robert you ROCK!

I couldn't get any of the vi searches to work on all occurrences and
like you said it left a blank line. Your sed commands worked
perfectly. Can you point me to an online resource about learning sed
and it's commands?

Thanks,
Brian



More information about the TriLUG mailing list