hiteksoftware.com Forum Index hiteksoftware.com
User discussion forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Find and replace spaces using Variable Manipulation

 
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Variables and Regular Expressions
View previous topic :: View next topic  
Author Message
ajharn



Joined: 30 Mar 2007
Posts: 56

PostPosted: Mon Apr 21, 2008 11:51 am    Post subject: Find and replace spaces using Variable Manipulation Reply with quote

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
View user's profile Send private message
ajharn



Joined: 30 Mar 2007
Posts: 56

PostPosted: Mon Apr 21, 2008 12:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
melvin
Site Admin


Joined: 25 May 2006
Posts: 595
Location: Santa Barbara, california

PostPosted: Mon Apr 21, 2008 9:43 pm    Post subject: Reply with quote

Glad to know that you figured it out. Smile
No, I do not know of a better approach.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Variables and Regular Expressions All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group