I would like to have a find/replace expression to truncate a field if it is longer than a specified length.
For example:
If the length of field <address></address> is longer than 60 characters, I would like to truncate the field to 60 characters. I use the following search to find each occurrence:
<address>.{61,}</address>
but I am not sure what to use to replace the field with the first 60 characters.
Thanks for any help.
Need find/replace expression to truncate length
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
- s_reynisson
- Posts: 939
- Joined: Tue May 06, 2003 1:59 pm
You got the right idea, but you have to capture the data using the ().
Find (<address>.{60}).*(</address>)
Replace \1\2
I have used POSIX regular expression syntax, which can be selected from the Editor page of the Preferences dialog box. HTH
Find (<address>.{60}).*(</address>)
Replace \1\2
I have used POSIX regular expression syntax, which can be selected from the Editor page of the Preferences dialog box. HTH
Then I open up and see
the person fumbling here is me
a different way to be
the person fumbling here is me
a different way to be