[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: search across linebreaks

From: Jude DaShiell
Subject: Re: search across linebreaks
Date: Sun, 17 Feb 2013 08:13:52 -0500 (EST)

On Sun, 17 Feb 2013, Eric Abrahamsen wrote:

> I'm going to need to do a large scale search-and-replace on a series of
> text files, using a sort of dictionary or hash-table of search terms and
> their replacement. The text files are filled to the usual fill column.
> The search terms may be broken across linebreaks, and I'm not sure of
> the best way to handle this. If it was regular English words I could
> probably manage a programmatic version of `isearch-toggle-word', but in
> this case these are solid strings, and might be broken anywhere.
> The two solutions I can think of are: 1) break up the characters in the
> search string and insert "\n?" between each one to create regexps to
> search on, and 2) unfill the whole file at the start of the procedure
> and then refill it afterwards. Neither of these seems like a great
> idea -- does anyone have any brighter ideas?
> Thanks,
> Eric
Think sed, and do yourself a huge favor and find a really experienced sed 
user because with the complexity of what you want to do now, that will 
probably be your best insurance against not leaving your project in a 
total mess.  If you must do all of this yourself, please consider sending 
blank email to and ask some questions 
on that email list before you take definitive action on your project.  
Also, remember there are people who belive in the religion of backups and 
then there are people who are going to get religion.  The sed-users email 
list is usually high signal and low noise and usually low volume in terms 
of traffic passed.
> > 

jude <> Remember Microsoft didn't write Tiger 10.4 
or any of its successors.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]