How can I replace a Carriage Return/Line Feeds (CR/LF) in macros?
How can I replace a Carriage Return/Line Feed (CR/LF) with another character or replace other characters with a CR/LF?
The solution is to save a CR/LF to a text string variable. Using the Variable Set to ASCII Character command, save the ASCII value (13) for a carriage return to a text string variable. Then save the ASCII value (10) for a line feed to another text string variable.
Use the Variable Modify String command to join the two together. The macro steps would look like this in Macro Express 5 or Macro Express Pro. It would be similar in Macro Express 3.
Variable Set to ASCII Char 13 to %T%
Variable Set to ASCII Char 10 to %T%
Variable Set String %T% to “%T%%T%”
Variable %T% now represents a CR/LF.
After saving a text string to a variable, use the Variable Modify String command – Replace Substring option. Replace any CR/LF’s in the string by inserting %T% in the Text to Replace field. Or replace other text with CR/LF’s by inserting %T% into the Replace Text With field.
Or if using the Text Type command, insert %T% into the text to play back a CR/LF.
– Applies to: Macro Express and Macro Express Pro