margaret Posted October 3, 2008 Report Posted October 3, 2008 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. Quote
stan Posted October 3, 2008 Report Posted October 3, 2008 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% Quote
terrypin Posted October 5, 2008 Report Posted October 5, 2008 What timing! I just came to the forum to ask almost exactly the same question (in my case replacing with a comma plus a space) and found this as the second post from top. Thanks Stan -- Terry, East Grinstead, UK Quote
margaret Posted October 5, 2008 Author Report Posted October 5, 2008 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! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.