Entry
TSE: Operation: Search: Replace: Line: New: How to insert a new line in search/replace? [CR/LF]
Jun 2nd, 2005 10:00
Knud van Eeden,
----------------------------------------------------------------------
--- Knud van Eeden --- 30 March 2005 - 11:47 pm ----------------------
TSE: Operation: Search: Replace: Line: New: How to insert a new line
in search/replace? [CR/LF]
---
Use a
\d013\d010
in the replace expression.
---
---
Steps: Overview:
1. -Create a macro
e.g.
--- cut here: begin --------------------------------------------------
PROC Main()
LReplace( "ab", "a\d013\d010b", "i" )
END
<F12> Main()
--- cut here: end ----------------------------------------------------
2. - Run this macro
3. -The output will be
a<ascii character 13><ascii character10>b
4. -You first will have to save and to load this
result to see that the output will have become
--- cut here: begin --------------------------------------------------
a
b
--- cut here: end ----------------------------------------------------
5. -Thus by inserting a linefeed, b has been put on a new line
===
e.g.
To replace 4 digits followed by a semicolon followed by 4 digits
1234;5678
with 4 digits followed by a semicolon followed a new lines followed
by 4 digits
1234;
5678
you could use
--- cut here: begin --------------------------------------------------
PROC Main()
LReplace( "{[0-9][0-9][0-9][0-9]\;}{[0-9][0-9][0-9][0-9]}", "\1\d013
\d010\2", "x" )
END
<F12> Main()
--- cut here: end ----------------------------------------------------
---
---
Note:
To see the new lines inserted, you should first save your file with
that replacements, and
then load that file again.
You will then see the new lines.
---
---
Internet: see also:
---
----------------------------------------------------------------------