MSH|^~\&|RAD|MCH|SOARCLIN|MCH|201309281506||ORU^R01|RMS|P|2.4
PID|0001|_MISSING_|059805^a~059805^a~059805^a||RENNER^KATHRYN^
In a string like the above I need to replace the string on basis of | (pipe sign) count.
e.g. :
MSH line want to replace after 3rth position of (|) pipe sign "MCH" with "ABC"
input : MSH|^~\&|RAD|MCH|SOARCLIN|MCH|201309281506||ORU^R01|RMS|P|2.4
output : MSH|^~\&|RAD|MCH|SOARCLIN|ABC|201309281506||ORU^R01|RMS|P|2.4