Answers
Sep 13, 2006 - 01:11 PM
You can create your pattern that will key off of the CR/LF found that the end of each line in the document (assuming, of course, there is a CR/LF at the end of each line) to "wrap" that CR/LF with the new code you want.
I'm not a huge RegEx guy but this should work:
Find: \r?\n
Replace with: DesiredEndofLine\r\nDesiredBeginningofLine
I hope this helps...a good site for learning about Regular Expressions is RegularExpressions.Info http://www.regular-expressions.info
Take care,
Ric
Sep 15, 2006 - 03:11 PM
Sep 18, 2006 - 11:31 AM
search: $
replace with: " &myCrLf
It puts " myCrLf at the end of every line but leaves out the &, any thoughts on this. Fixes?
Sep 18, 2006 - 03:21 PM
Try:
search: $
replace with: " !myCrLf
and then go back and try:
search: !
replace with: &
Or, look to see if you can "escape" a character...it might be treating that & symbol as a special character like it's treating the $ and the ^
I hope this helps,
Ric
Sep 19, 2006 - 01:15 AM
Or, you could switch over to Notepad which doesn't treat the & as a special character and do the second pass on the replace. I know...a long way to get to where you want to go, but it may be the only way.
Ric
Sep 19, 2006 - 07:07 AM
Your response really helped a lot. It was required to do a second pass, just had to make sure that Regular Expressions was checked on the first pass and then unchecked on the second one.
I finally did a
search: $
replace with: " &myCrLf
WITH the regular expressions activated
and then went back and did a:
search: " myCrLf
replace with: " &myCrLf
with them not activated. Worked like a charm.
Nov 18, 2012 - 01:37 AM
You can do it easily using notepad++. Its supported in Windows, Mac and Linux.
A detailed help is here:
http://dotnet-programming-solutions.blogspot.com/2012/11/how-to-add-text-to-beg
inning-or-end-of.html
Jan 10, 2015 - 11:43 AM
Add </title> to the end of lines 1, 3, 5, etc...
Then:
Add <link> to the beginning of even number lines (e.g. lines 2, 4, 6, 8, etc...)
Add </link> to the end of even number lines (e.g. lines 2, 4, 6, 8, etc...)
Add New Comment