Page 1 of 1
Indent character? or RegEx code
Posted: Tue Dec 01, 2009 2:15 am
by ineuw
Is there a RegEx code for indent? Failing that, is there a character which represents the indent? I am trying to search and replace them in documents but found no reference in help and in the forum.
Posted: Tue Dec 01, 2009 2:50 am
by Bob Hansen
Not sure what you mean by "indent" code. TextPad RegEX uses \t for tabs, is that what you want?
Best to provide us with a before and after example of what you are working with and what you want the result to look like.
Posted: Tue Dec 01, 2009 3:19 am
by ineuw
Bob Hansen wrote:Not sure what you mean by "indent" code. TextPad RegEX uses \t for tabs, is that what you want?
Best to provide us with a before and after example of what you are working with and what you want the result to look like.
Thanks for the speedy response. I proofread and format text using TexPad and am well versed with the use of Regular Expressions in Find and Search and Replace.
I would like to Find the occurrences of \n\n (paragraph breaks) and replace them with \n\n and the indent code assigned to Ctrl+I. Using \n\n\t is not what I am looking for. The indent is necessary because I use the word wrap. (TextPad is set to the Microsoft keyboard compatibility mode.)
Thanks
Posted: Tue Dec 01, 2009 8:38 am
by ManChicken
You could do this as a record macro:
Perform a Find
Search for \n$
Turn on 'Regular expression'
Click 'Find Next'
Click 'Close' to close the Find dialog
Press the cursor down key once
Hit Ctrl-I
Posted: Wed Dec 02, 2009 4:08 am
by ineuw
ManChicken wrote:You could do this as a record macro:
Perform a Find
Search for \n$
Turn on 'Regular expression'
Click 'Find Next'
Click 'Close' to close the Find dialog
Press the cursor down key once
Hit Ctrl-I
Many thanks ManChicken.
Posted: Wed Dec 02, 2009 8:24 am
by ben_josephs
I don't understand why a macro should be necessary for this. What are your settings for the document class in
Configure | Preferences | Document Classes | <Class> | Tabulation
or for the current document in
View | Document Properties | Tabulation
?
Can you not find settings there that cause an inserted tab to be converted into whatever you want for your indents?
Posted: Wed Dec 02, 2009 2:38 pm
by ineuw
ben_josephs wrote:I don't understand why a macro should be necessary for this. What are your settings for the document class in
Configure | Preferences | Document Classes | <Class> | Tabulation
or for the current document in
View | Document Properties | Tabulation
?
Can you not find settings there that cause an inserted tab to be converted into whatever you want for your indents?
Replacement must be selective and tabs must be retained elsewhere in the document. The change is not universal, so a macro is the way to go. However, my post is altogether unnecessary, and for this I apologize.
I am using TextPad extensively for OCR text formatting, a sort of hybrid word processor. For this, the line wrap is on by default which caused my conceptual misunderstanding. First, the text is cleaned, spell checked and the final text is wikified with MediaWiki code. I also use several word processors for document formatting, and expected certain behaviours to be the same across the board.
Thanks for all the replies.