I'm not familiar with Textpad - I use Notepad ++ for this type of chore - but check to see if TextPad will support doing a Find/Replace using a Regular Expression pattern, or look to a deditcated piece of RegEx software such as Regex Suite.
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
|
|
Expert:
|
rcastagna
|
|
Date:
|
Sep 13, 2006
|
|
Time:
|
16:11
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
|
Tried that out but it just gave me a an error that said "Cannot find literal string \r?\n". I also tried it with just "\r\n" because I wasnt sure if that question mark was a typo but it had the same response.
|
|
Expert:
|
john2
|
|
Date:
|
Sep 15, 2006
|
|
Time:
|
18:11
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
|
I found in textpad you can put a ^ to replace all items at the beginning of the line and then $ for the end, but for some reason if there is an ampersand in the text you are trying to insert, it doesnt get inserted. Example.
search: $
replace with: " &myCrLf
It puts " myCrLf at the end of every line but leaves out the &, any thoughts on this. Fixes?
|
|
Expert:
|
john2
|
|
Date:
|
Sep 18, 2006
|
|
Time:
|
14:31
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
|
John,
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
|
|
Expert:
|
rcastagna
|
|
Date:
|
Sep 18, 2006
|
|
Time:
|
18:21
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
|
John,
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
|
|
Expert:
|
rcastagna
|
|
Date:
|
Sep 19, 2006
|
|
Time:
|
04:15
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
|
Hey rcastagna,
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.
|
|
Expert:
|
john2
|
|
Date:
|
Sep 19, 2006
|
|
Time:
|
10:07
|
|
|
|
Votes: Good (0) | Bad (0) Login to rate this answer
|
|
|
|
|
|
|
This question has been answered, and points have been rewarded to the following experts:
You're welcome however to comment or give additional information or if you wish, you have the ability to write an Answer Summary for this question by clicking on the "Answer Summaries" Tab.
|
|