[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jedit-users
Subject:    Re: [ jEdit-users ] add comma to end of multiple lines
From:       "Suraj N. Kurapati" <snk () gna ! org>
Date:       2008-04-07 23:05:58
Message-ID: 622353.25508.qm () web83302 ! mail ! sp1 ! yahoo ! com
[Download RAW message or body]

Dimitri Maziuk wrote:
> On Monday 07 April 2008 15:27:59 e-letter wrote:
> > To clarify, I wanted a comma to be placed at the
> > end of lines where the last character was either
> > a double quotation mark or a number.
> > Please do not confuse the double quotation mark
> > with the empty variable '[whitespace]'
> 
> sed -r 's/([0-9"])$/\1,/g' 
> 
> IOW replace digit or double quote at the end of the
> line with itself plus comma.

In jEdit's search & replace dialog, the above would
be:

1. enable the regular expressions check-box

2. enable the "return value of BeanShell" radio-box

3. type this into the search box:

  ([0-9"])$

4. type this into the replace box:

  _1 + ","

Nevertheless, I agree with Dima: you'd be much more
productive after learning how to use standard UNIX
tools and/or regular expressions.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
-- 
-----------------------------------------------
jEdit Users' List
jEdit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic