[prog] replacement strings

Miriam English mim at miriam-english.org
Wed May 26 13:19:30 UTC 2010


Hi Tricia,

Thanks for the pointer to SciTE. I noticed that geany uses the same 
regular expressions as SciTE (they reference SciTE in their regex 
documentation). I downloaded and tried to compile SciTE, but it seems I 
need to upgrade my GTK. Oh well... it is past due for me to upgrade my 
Linux, so I'll try SciTE after I upgrade in the near future.

Thanks also for the mention of perl one-liners. It turns out there is a 
goldmine of them out there on the net, with ways of doing things I just 
would not have considered. My perl is pretty rusty these days. This will 
be a great way to brush up.

	- Miriam

Tricia Bowen wrote:
> Hi Mariam,
> Try SciTE and see it that comes close to TextPad. It has the regular 
> expression functionality that you're looking for: 
> http://www.scintilla.org/SciTERegEx.html. You should try the perl 
> oneliners though because they come in very handy when doing regular 
> expressions.
>  
> perl -pi.bak -e 's/^(abc)(xyz)/$2$1/g'
>  
> --Tricia
> On Mon, May 24, 2010 at 5:05 AM, Miriam English <mim at miriam-english.org 
> <mailto:mim at miriam-english.org>> wrote:
> 
>     At the risk of looking stupid again...
> 
>     I've been spending hours trying to find something that does the same
>     thing as TextPad's join command. (I really want to get rid of my
>     need for wine.)
> 
>     It joins highlighted text into single lines, keeping paragraphs
>     distinct. The closest I've been able to find is the fmt command
>     (part of the Gnu coreutils, and should be in most linuxes).
>     Unfortunately that has an upper limit of 2,500 characters in a
>     paragraph, which is unrealistic when trying to reformat some texts,
>     especially old ones where most of a page might be a single paragraph.
> 
>     I have a feeling I might need to write a program to do the job, but
>     that wouldn't be interactive so would have to make automated
>     decisions on whether something should be joined or not based on line
>     length (to leave bits of verse alone). [sigh] I've been spoiled by
>     TextPad and its easy ability to select a range then join every line
>     within the selection while retaining paragraphs.
> 
>     Surely people must have needed this in the Linux world before...
> 
>            - Miriam
> 
> 
>     Sam Watkins wrote:
> 
>         On Mon, May 24, 2010 at 01:39:41PM +1000, Miriam English wrote:
> 
>             I just re-read the relevant part of geany's  manual and
>             found that it can do
>             tagged replacements, though with a  slightly different
>             syntax than I normally
>             use.
> 
>             Thanks again Sam. You've opened my eyes to other things.
> 
> 
>         Another thing you can do with good editors (e.g. vim and emacs)
>         is record
>         keyboard macros.  You can do complicated edits then repeat them,
>         it is more
>         powerful than search and replace.
> 
>         Sam
> 
> 
> 
>     -- 
>     If you don't have any failures then you're not trying hard enough.
>      - Dr. Charles Elachi, director of NASA's Jet Propulsion Laboratory
>     -----
>     Website: http://miriam-english.org <http://miriam-english.org/>
>     Blog: http://miriam_e.livejournal.com <http://miriam_e.livejournal.com/>
>     _______________________________________________
>     Programming mailing list
>     Programming at linuxchix.org <mailto:Programming at linuxchix.org>
>     http://mailman.linuxchix.org/mailman/listinfo/programming
> 
> 
> 
> 
> -- 
> -=-=-=-=-=-=-=-=-=-=-=-=-
> Tricia Bowen
> 845.255.1875
> tricia.bowen at gmail.com <mailto:tricia.bowen at gmail.com>
> -=-=-=-=-=-=-=-=-=-=-=-=-
> 

-- 
If you don't have any failures then you're not trying hard enough.
  - Dr. Charles Elachi, director of NASA's Jet Propulsion Laboratory
-----
Website: http://miriam-english.org
Blog: http://miriam_e.livejournal.com


More information about the Programming mailing list