#1
|
|||
|
|||
Finding string at end of line
Given:
Y1.571 X-20.3033 Z7.802 F80. A-.761 C-90. X-19.7012 Z7.7895 A-1.525 C-93.776 X-19.0993 Z7.769 A-2.288 X-18.4977 Z7.7405 A-3.051 X-17.8965 Z7.704 A-3.813 X-17.296 Z7.6596 A-4.576 X-16.6961 Z7.6072 A-5.339 I'm trying to isolate any string alone on on a line. I always thought that a line ends with either a paragraph marker ^p or a ^l . When I attempt to do a search for either a string at the end of line or just the end of line character itself, the search fails. In fact, searching for a ^p yields the following error message: "^p is not a special character for the Find What box or is not supported when the Use Wildcards check box is selected." What's going on? Other references speak of being able to use ^p. Has something changed? I used to use it myself. |
#2
|
|||
|
|||
Quote:
|
#3
|
|||
|
|||
I could have sworn I tried that and it didn't work. Thanks again.
|
#4
|
|||
|
|||
This could possibly be due to your document settings or the version of Word you are using. It is possible that your version of Word may have a change in how the paragraph marker (^p) is handled or how it is treated within search. Alternatively, try using other special characters such as end of line (^l) or end of paragraph (¶) to search for paragraphs in your document.
|
#5
|
|||
|
|||
Nah I just read that I cannot search for a ^p. It has to be a chr(13) or something.
|
#6
|
|||
|
|||
You can search for ^p if the Match Wild Cards attribute is set to false.
|
#7
|
|||
|
|||
Yes but can you search for a mixed string that includes ^p and other wildcards with the Match Wild Cards set to false, e.g. "X*Y*^p"?
|
#8
|
|||
|
|||
No, the wildcard characters e.g., *, {, ] etc. are treated as literal characters if Match Wild Cards is set to false.
|
#9
|
|||
|
|||
You can use ^013 instead of ^p when using wildcards.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Establish a new range after finding a string | RobiNew | Word VBA | 4 | 12-16-2023 01:54 AM |
Subscript out of Range Error when searched for string and its line number in Text File | SamDsouza | Word VBA | 4 | 01-12-2021 07:08 PM |
finding a string containing a combination of formats and adding text before | Marco | Word VBA | 1 | 11-02-2015 05:08 PM |
search for string, wherever found, at end of line, insert 8 <cr>s | sbktex | Word VBA | 2 | 09-17-2014 04:09 PM |
Replace paragraph-marks (line-breaks) in tables with a character-string | Aztec | Word VBA | 2 | 04-02-2013 10:52 PM |