[prog] replacement strings

Miriam English mim at miriam-english.org
Mon May 24 09:05:54 UTC 2010


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


More information about the Programming mailing list