[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Regexp that solves this ?
From: |
Emilio Lopes |
Subject: |
Re: Regexp that solves this ? |
Date: |
Wed, 29 Aug 2007 20:37:20 +0200 |
User-agent: |
Emacs Gnus |
weber writes:
> I'd like to know if there is a simple way to replace regexp a file to
> convert tables like this:
> | name | value |
> | x1 | 1001 |
> | x2 | 2002 |
> to this
> || name | value |
> | x1 | 1001 |
> | x2 | 2002 |
Does the following works?
(query-replace-regexp "^[[:space:]]*\n|[^|]" "\n||")
When calling `query-replace-regexp' interactively use "^Q^J" to input
a newline, instead of "\n" as above.
--
EmÃlio C. Lopes
Munich, Germany