Insert ascii 28 and carriage return linefeed

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
agent86
Posts: 18
Joined: Wed Apr 26, 2006 2:59 am
Location: SF Bay Area

Insert ascii 28 and carriage return linefeed

Post by agent86 »

I have a text file and everytime I encounter "MSH|", I want to preceede it with an ascii 28 ( file seperator) and a carriage return/linefeed so I get the following results.

before:

OBX|135|FT|REPORT|135|
MSH|^~\&|CELLNETIX|PATHOLOGY|||200801121247||ORU^R01|

after:

OBX|135|FT|REPORT|135|

MSH|^~\&|CELLNETIX|PATHOLOGY|||200801121247||ORU^R01|


Thank you...
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Find what: MSH
Replace with: \x1C\nMSH

[X] Regular expression

Replace All
(Hexadecimal 1C = decimal 28.)

This assumes you are using Posix regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
Post Reply