Adding " at the beginning and end of every line
-
I was given the following info and it worked until yesterday but does not work today. This is VERY strange. Instead of adding just a double quote at the beginning or end, it replaces the first or last character with the & symbol.
For example, you can add a quote at the end of every line:
Edit > Find & Replace
Search for: .$
Replace with: &"Options/Regular expressions: ON
Click Replace All
And, similarly, at the beginning:
Search for: ^.
Replace with: "&I have restarted the program and reloaded the document with no success. What is wrong now? I have tried it over and over again and get the same result.
Thanks.
-
I think you need to write
$&"and"$&for replacement. You may want to use[^"]instead of.to skip lines already beginning/ending with". Use[^"\r\n]to also skip empty lines. -
Hello @W-C
when having
Search for: $ Replace with: "and
Search for: ^ Replace with: "then it should have worked but not with the dot char added and with the restriction gerdb42 mentioned.
You can also use a single regex, something like
Search for: ^(.+)$ Replace with: "\1"Search for explained:
^ = from the beginning of the line
(.+) = looking for atleast one but as much as possible chars and return the match until
$ = end of line is reachedReplace with explained:
" = insert a double quote followed by the
\1 = matched result and
" = add an additional double quoteCheers
Claudia
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login