[prog] replacement strings

Tricia Bowen tricia.bowen at gmail.com
Mon May 24 13:34:45 UTC 2010


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>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
> Blog: http://miriam_e.livejournal.com
> _______________________________________________
>  Programming mailing list
> Programming at linuxchix.org
> http://mailman.linuxchix.org/mailman/listinfo/programming
>



-- 
-=-=-=-=-=-=-=-=-=-=-=-=-
Tricia Bowen
845.255.1875
tricia.bowen at gmail.com
-=-=-=-=-=-=-=-=-=-=-=-=-


More information about the Programming mailing list