G
guru
Hi All,
I have one requirement where I need to capture statement beginning
with "msg_pri". This may span multiple lines.
Cases
1. msg_pri (........................);
2. msg_pri (........................)
3. msg_pri (........................) \
other cases
same as above , but they may span multiple lines.
4. msg_pri (........................,
..............);
Below perl script convert multiple line msg_pri in to single line and
handling case 1 and case 2, 4.
It is not handling the case 3. It will hang when it encounters case 3.
system("perl -i -ne \' unless(<EOF>){ if(/msg_pri.?\\(/i) { until(/[\;
\)]\$/) { chomp; s/\\s+/ /; print; \$_ = <>;} s/\\s+/ /;} print }\'
$process_file");
I modified "until(/[\;\)]\$/" to "until(/[\\\;\)]\$" in the above
statement then also it is not handling.
How to modify this to handle all the above cases or any other way to
do this in perl.
Please let me know if you need any other info.
Thanks & Regards
Gururaja
I have one requirement where I need to capture statement beginning
with "msg_pri". This may span multiple lines.
Cases
1. msg_pri (........................);
2. msg_pri (........................)
3. msg_pri (........................) \
other cases
same as above , but they may span multiple lines.
4. msg_pri (........................,
..............);
Below perl script convert multiple line msg_pri in to single line and
handling case 1 and case 2, 4.
It is not handling the case 3. It will hang when it encounters case 3.
system("perl -i -ne \' unless(<EOF>){ if(/msg_pri.?\\(/i) { until(/[\;
\)]\$/) { chomp; s/\\s+/ /; print; \$_ = <>;} s/\\s+/ /;} print }\'
$process_file");
I modified "until(/[\;\)]\$/" to "until(/[\\\;\)]\$" in the above
statement then also it is not handling.
How to modify this to handle all the above cases or any other way to
do this in perl.
Please let me know if you need any other info.
Thanks & Regards
Gururaja