RE Search & Replace for lines with a specific HEX

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
iandg
Posts: 2
Joined: Sun Nov 15, 2009 6:30 pm

RE Search & Replace for lines with a specific HEX

Post by iandg »

Hi All

I want to insert text into the end of all lines in a document that contain a specific hex character value (0x97 representing —) so a block of text like:-

Code: Select all

Post your question in our Community Forums, where many 
expert users may be able — to help you out. 
Suggest and vote for enhancements in our Enhancement Suggestion Forum. 
Only if you have exhausted every other option, or have a 
purchase — or licensing question, submit your query using the 
TextPad feedback form or the WildEdit feedback form. 
becomes:-

Code: Select all

Post your question in our Community Forums, where many 
expert users may be able — to help you out. xxxx
Suggest and vote for enhancements in our Enhancement Suggestion Forum. 
Only if you have exhausted every other option, or have a 
purchase — or licensing question, submit your query using the xxxx
TextPad feedback form or the WildEdit feedback form. 
The document has complex multi-line records which happen to have a '—' in the last line of each record. Having flagged the last line feed of each record with xxxx, all line feeds will be replaced with tabs and then the xxxx replaced with a line feed.

If there is another way to achieve the same result I am open to any suggestions
Kind regards

Ian
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Find what: \x97.*
Replace with: \0 xxxx

[X] Regular expression
Or just paste an em dash into the search expression (in place of the \x97).
Last edited by ben_josephs on Mon Nov 16, 2009 9:58 am, edited 1 time in total.
iandg
Posts: 2
Joined: Sun Nov 15, 2009 6:30 pm

Thanks Ben

Post by iandg »

That worked fine, thank you.

Just to correct my original post, I will have to replace xxxx\t with the \n after converting all the line feeds to tabs.
Kind regards

Ian
Post Reply