| View previous topic :: View next topic |
| Author |
Message |
ajharn
Joined: 30 Mar 2007 Posts: 56
|
Posted: Mon Apr 21, 2008 11:51 am Post subject: Find and replace spaces using Variable Manipulation |
|
|
Hello again,
I have a case where I have a filename with spaces in it that I want to use in a hyperlink in an e-mail that goes out. I need to replace the spaces in the filename with "%20" for linking purposes. I'm sending a straight URL in the e-mal, not an HREF, since the e-mail is going out as text format and I don't know what e-mail clients will be used to read it.
My approach was to use Variable Manipulation to find each Space, and replace it with a "%20" string. However, I'm having trouble figuring out how to "find" a space with variable manipulation.
Will it recognize a character code or hex value for a space, or some such?
Please advise, and do let me know if there is a smarter way to solve this problem.
Thanks much.
AJ |
|
| Back to top |
|
 |
ajharn
Joined: 30 Mar 2007 Posts: 56
|
Posted: Mon Apr 21, 2008 12:19 pm Post subject: |
|
|
Okay,
I figured out how to do this with REGEX. It was new to me as a 6.x user and not otherwise a code jockey - But very simple and powerful. Thanks for including it. And thanks for Variable Manipulation. Huge time saver.
For reference. Using the Variable Manipulation task, I chose the variable (Task::Filename) that I wanted to take the spaces out of and did:
Find: /s (REGEX for space character)
Replace: %20
Which changed "NAME WITH SPACES" to "NAME%20WITH%20SPACES%20"
If you see a better approach to solving my base problem, please holler at me.
Thanks,
AJ |
|
| Back to top |
|
 |
melvin Site Admin
Joined: 25 May 2006 Posts: 595 Location: Santa Barbara, california
|
Posted: Mon Apr 21, 2008 9:43 pm Post subject: |
|
|
Glad to know that you figured it out.
No, I do not know of a better approach. |
|
| Back to top |
|
 |
|