[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
string-replace interactive function hit or miss?
From: |
ChristineLWilson |
Subject: |
string-replace interactive function hit or miss? |
Date: |
11 Feb 2006 12:01:31 -0800 |
User-agent: |
G2/0.2 |
Hi,
I have a large text file that I need to replace multiple pieces of
text with other chunks...so I open my file in emacs, make my function
interactive, but it seems as though the replacements are happening hit
or miss. Any ideas why this isn't running properly and how I can make
it complete/reliable? Please see the function and text chunk below.
Thanks,
Christine
;;the interactive function
(defun replacegoals ()
(interactive)
(goto-char (point-min))
(replace-string "(goal qleadin" "\"Consider the following
question:<P>\", \"GNAME:qleadin\",")
(replace-string "(goal e1b1.q" "\"<B>Suppose that the suitcase has no
wheels, and is instead subject to a frictional force as it slides
across the floor. If everything else were the same, how would the work
done by the strap on the suitcase change?</B>\", \"GNAME:e1b1.q\",")
(replace-string "(goal dummyans" "\"<P>Please enter your answer:\",
\"GNAME:dummyans\",")
(replace-string "(goal ialeadin" "\"Here is how a physics expert
answered the same question:<P>\", \"GNAME:ialeadin\",")
;;;and so on....
)
;;a chunk of the text file
(goal e1b1ctr
(goal qleadin
"Consider the following question:<P>")
(goal e1b1.q
"<B>Suppose that the suitcase has no wheels, and is instead subject to
a frictional force as it slides across the floor. If everything else
were the
same, how would the work done by the strap on the suitcase
change?</B>")
(goal dummyans "<P>Please enter your answer:"
(("$anything else$")))
(goal ialeadin
"Here is how a physics expert answered the same question:<P>")
- string-replace interactive function hit or miss?,
ChristineLWilson <=