Register  |  Login

Question Details    

   Question

Time: 14:20 - Sep 13, 2006     Asked by: john2      Status: Answered      Points: 125   

How do I add similar text to the beginning of every line in textpad without doing it one at a time?

I have a textpad document where I am editing my HTML code. If I need to go through a portion of text and add something like ( pagebody=' ), is there a way to do this without having to just use the paste function and manually go through every line and paste? Also, how do I add similar text to the END of every line also?

Ask a New Question

Become a Quomon Expert

Current Categories

 

Other Questions Needing Answers


   

Answer Discussion
Answer Discussion
Answer Summaries
Answer Summary
 
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

Question Answered

This question has been answered, and points have been rewarded to the following experts:

rcastagna: 125

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.

 
No summaries have been submitted yet. Want to be the first?



Respond to this question:

New User

  Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:


Forgotten Password

 

New User

  Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:


Forgotten Password
   

"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it


All Questions


Language Options

English:

www.quomon.com

Español:

www.quomon.es

Sponsors

Questions and Answers Software
Real Estate Postcards
Marketing Fulfillment