Jump to content
Macro Express Forums

can I take a string variable and replace returns in it with spaces?


margaret
 Share

Recommended Posts

I'm trying to take a string from the clipboard and replace all paragraph returns within the string with spaces. I understand how to get the string. But the option to Strip CR/LF just removes the returns, mushing two words together. I tried the replacement option, but it doesn't seem to understand either "CR/LF" or "<CR/LF>". The position of the return within the string is not predictable. Is it impossible to do what I want? Or is there some other way to communicate a return to the command for modifying variables?

Thanks.

Link to comment
Share on other sites

Below are the steps you need to take. Set the ASCII Values for Carriage Returns (13) and Lines Feeds (10) to text string variables. Consolidate the two into one variable with 13 followed by 10. Use the Replace Substring option to replace the consolidated variable (carriage return/line feed) with a space.

 

Variable Set %T1% to ASCII Char of 13

Variable Set %T2% to ASCII Char of 10

Variable Modify String: Append %T2% to %T1%

Replace "%T1%" with " " in %T10%

Link to comment
Share on other sites

Below are the steps you need to take. Set the ASCII Values for Carriage Returns (13) and Lines Feeds (10) to text string variables. Consolidate the two into one variable with 13 followed by 10. Use the Replace Substring option to replace the consolidated variable (carriage return/line feed) with a space.

 

Variable Set %T1% to ASCII Char of 13

Variable Set %T2% to ASCII Char of 10

Variable Modify String: Append %T2% to %T1%

Replace "%T1%" with " " in %T10%

 

Thank you so much. This is great! I got it to work. This is going to save a enormous amount of time!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...