Converting a reference string to lowercase

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

brynlund
Posts: 4
Joined: Fri Feb 15, 2008 8:00 am

Converting a reference string to lowercase

Postby brynlund » Fri Feb 15, 2008 8:14 am

I am performing the following search and replace:

[Ii]-(\w{3,})-(\d{3,})
(eg. I-ABC-123)

Replace with:

<a href="http://www.xxx.com/dir1/dir2/dir3/i-$1-$2.pdf">$0</a>

This is basically working, however the string that I receive in $1 (in the above example, ABC) is currently in uppercase and I would like to convert it to lowercase in the hyperlink.

Any suggestions?

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

Postby DataMystic Support » Fri Feb 15, 2008 10:31 am

Yes, add a Convert to lowercase subfilter, and the entire replacement will become lowercase.
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

brynlund
Posts: 4
Joined: Fri Feb 15, 2008 8:00 am

Postby brynlund » Fri Feb 22, 2008 7:01 am

I haven't been able to figure out how to do that. I can't find any examples in the user help files and nothing I've tried actually works. Based on the previous example, what would that look like?

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

Postby DataMystic Support » Fri Feb 22, 2008 7:52 am

See lesson 5 in the help file. (About fifth item down in the contents).

It looks like this:

Code: Select all

Perl pattern [[Ii]-(\w{3,})-(\d{3,}) ] with [<a href="http://www.xxx.com/dir1/dir2/dir3/i-$1-$2.pdf">$0</a> ]
|  [X] Match case
|  [ ] Whole words only
|  [ ] Case sensitive replace
|  [ ] Prompt on replace
|  [ ] Skip prompt if identical
|  [ ] First only
|  [ ] Extract matches
|  Maximum text buffer size 4096
|  [ ] Maximum match (greedy)
|  [ ] Allow comments
|  [X] '.' matches newline
|  [ ] UTF-8 Support
|
+--Convert to lowercase
   
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

brynlund
Posts: 4
Joined: Fri Feb 15, 2008 8:00 am

Postby brynlund » Thu Feb 28, 2008 6:09 am

The result isn't exactly what I'm after. I'm trying to end up with the following hyperlink:
<a href="http://www.xxx.com/Dir1/Dir2/Dir3/i-$1-$2.pdf">$0</a>

Where parts of the path could potentially be upper and/or lower case. However, I need to make ONLY what appears in the string from $1 to be lowercase, while leaving the rest of the path untouched. The example that you provided me converts the entire hyperlink to lowercase instead of just what appears in $1.

Is this doable?

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

Postby DataMystic Support » Mon Mar 03, 2008 10:37 am

Yes, change the Action field of the search/replace from 'Replace' to 'Send variable 1 to subfilter'. Keep the lowercasing subfilter as before.
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

brynlund
Posts: 4
Joined: Fri Feb 15, 2008 8:00 am

Postby brynlund » Thu Mar 06, 2008 7:32 am

Where would I find the action field in version 6.5.1? I've looked and can't find it anywhere.

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

Postby DataMystic Support » Thu Mar 06, 2008 8:07 am

It doesn't exist.

You need 7.8.10 or higher.
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 7 guests