Every time I find a line that starts with 'MSH|^~\&|' I want to insert a line before that line that contains '***End***'. For example:
MSH|^~\&|POWERP
PID|1||||SPROSS
PV1|1||||||1693
ORC|SC|FN080111
MSH|^~\&|POWERP
PID|1||||SPROSS
PV1|1||||||1693
ORC|SC|FN080111
MSH|^~\&|POWERP
PID|1||||SPROSS
PV1|1||||||1693
ORC|SC|FN080111
becomes
***End***
MSH|^~\&|POWERP
PID|1||||SPROSS
PV1|1||||||1693
ORC|SC|FN080111
***End***
MSH|^~\&|POWERP
PID|1||||SPROSS
PV1|1||||||1693
ORC|SC|FN080111
***End***
MSH|^~\&|POWERP
PID|1||||SPROSS
PV1|1||||||1693
ORC|SC|FN080111
Insert '***End***' before...
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
1. Make sure you have a blank line at the top.
2. Search for: \nMSH
Replace with \n***End***\nMSH
=============================
Use the following settings:
-----------------------------------------
[X] Regular expression
Replace All
-----------------------------------------
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-----------------------------------------
2. Search for: \nMSH
Replace with \n***End***\nMSH
=============================
Use the following settings:
-----------------------------------------
[X] Regular expression
Replace All
-----------------------------------------
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-----------------------------------------
Hope this was helpful.............good luck,
Bob
Bob
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm