mrrmpc
asked on
How would I delete the first 10 characters from a line using regex in Notepad++?
I have a bulk file that has multiple HL7 messages contained in the file. Each message block starts with MSH segment. However the batch file has index id numbers prepended to the string. I need to remove the 10 characters before the 'MSH' and replace with blank.
I am using Notepad++ as the editor and I think this can be done possibly with regex but I don't know how to accomplish the task. I have no regex experience, nor programming/scripting.
Thanks in advance for the assistance.
Current data example:
0000000764MSH|^~\&|RELAYHE ALTH|RWJSL |RELAYHEAL TH|RWJSL|2 0170622085 225||ADT^A 14|WIEH52W IJQQ7Q6JQV A7E|P|2.5
EVN|A14|20170622085225
...
0000000924MSH|^~\&|RELAYHE ALTH|RWJSL |RELAYHEAL TH|RWJSL|2 0170622091 618||ADT^A 14|TQSJB2C G9GTZH8SY8 HWB|P|2.5
EVN|A14|20170622091618
...
0000000742MSH|^~\&|RELAYHE ALTH|RWJSL |RELAYHEAL TH|RWJSL|2 0170622091 619||ADT^A 14|EF0S0NG HIZLQGAYAM PT4|P|2.5
EVN|A14|20170622091619
Desired output would be:
MSH|^~\&|RELAYHEALTH|RWJSL |RELAYHEAL TH|RWJSL|2 0170622085 225||ADT^A 14|WIEH52W IJQQ7Q6JQV A7E|P|2.5
EVN|A14|20170622085225
...
MSH|^~\&|RELAYHEALTH|RWJSL |RELAYHEAL TH|RWJSL|2 0170622091 618||ADT^A 14|TQSJB2C G9GTZH8SY8 HWB|P|2.5
EVN|A14|20170622091618
...
MSH|^~\&|RELAYHEALTH|RWJSL |RELAYHEAL TH|RWJSL|2 0170622091 619||ADT^A 14|EF0S0NG HIZLQGAYAM PT4|P|2.5
EVN|A14|20170622091619
I am using Notepad++ as the editor and I think this can be done possibly with regex but I don't know how to accomplish the task. I have no regex experience, nor programming/scripting.
Thanks in advance for the assistance.
Current data example:
0000000764MSH|^~\&|RELAYHE
EVN|A14|20170622085225
...
0000000924MSH|^~\&|RELAYHE
EVN|A14|20170622091618
...
0000000742MSH|^~\&|RELAYHE
EVN|A14|20170622091619
Desired output would be:
MSH|^~\&|RELAYHEALTH|RWJSL
EVN|A14|20170622085225
...
MSH|^~\&|RELAYHEALTH|RWJSL
EVN|A14|20170622091618
...
MSH|^~\&|RELAYHEALTH|RWJSL
EVN|A14|20170622091619
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER