shrotening length of same characters words

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

Aircut
Posts: 12
Joined: Sun Oct 28, 2012 2:09 pm

shrotening length of same characters words

Postby Aircut » Fri Nov 09, 2012 12:41 pm

i need to find any words (or punctuation) that are composed of more than 4 letters of the same character and shorten them to 4

that is

AAAAAAAAAAA -> AAAA
???????????????? -> ????
........................... -> ....
Brrrrrrrrrrrrrrrrr -> Brrr

any help would be appriciated

User avatar
DataMystic Support
Site Admin
Posts: 2154
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: shrotening length of same characters words

Postby DataMystic Support » Mon Nov 12, 2012 8:35 am

Use a perl regex search/replace

Search for

Code: Select all

([a-z\?\.]){5,}?


Replace with:

Code: Select all

$1$$1$$1$$1$
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

Aircut
Posts: 12
Joined: Sun Oct 28, 2012 2:09 pm

Re: shrotening length of same characters words

Postby Aircut » Mon Nov 12, 2012 1:26 pm

thanks but it doesnt work, i created the rule for perl pattern search/replace

in the trial box i entered
............................
no changes....

User avatar
DataMystic Support
Site Admin
Posts: 2154
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: shrotening length of same characters words

Postby DataMystic Support » Mon Nov 12, 2012 2:36 pm

Check for extra white space or carriage returns at the end of the search phrase.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: No registered users and 1 guest