emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] searching for links [8.3.3 (8.3.3-17-gce80a0-elpaplus @ c:/USR/F


From: Nick Dokos
Subject: Re: [O] searching for links [8.3.3 (8.3.3-17-gce80a0-elpaplus @ c:/USR/FJM/APP/.emacs.d/elpa/org-20160118/)]
Date: Mon, 01 Feb 2016 16:07:59 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

"Francis J. Monari, Esquire" <address@hidden> writes:

> Due to file relocation on the server, I have a number of broken links in
> an org document.  (problem: broken links.)
>
> How can I / Is it possible to search and replace on links?
> (expectation: I would like to use search and replace to fix the links.)
>
> I have tried search and replace, but emacs advises me that links have
> been filtered out.  (issue: emacs reports that results from the search
> are filtered-out.)
>
> The answer might be a "works as expected".  I would like to remain
> within the org framework (but using standard search and replace) and
> accomplish this task.
>

Nevertheless, one-time global changes, like this, are best handled by
using tools other than an interactive editor. One of the strengths of
org-mode is that org files are plain-text and can therefore be
manipulated by many tools: I would suggest a simple sed script (sed is
available even on Windows through cygwin I think) - something like this

 sed 's/old/new/g' infile > outfile

It is even more advantageous if you have more than one file to change.
Emacs has mechanisms for doing something to many files, but none of them
beats a simple shell loop:

for x in file1 file2 file3 ;do
   sed 's/old/new/g' $x > $x.new
done

--
Nick












reply via email to

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