Hello List,
I m trying to print the multiple lines to one base on certain pattern e.g.
Source:
Sun Feb 8 line1
line2
line3
Mon Feb 9 line4
line5
Tue Feb 10 line6
line 7
line 8
Target
Sun Feb 8 line1 line2 line3
Mon Feb 9 line4 line5
Tue Feb 10 line6 line7 line8
I can accomplish this using gawk b/c gawk allows regex to define RS, but can I use the same concept in PERL?
a2p translate it into below but it does not work,
$/ = '(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Dec|No
v) ( 1| 2| 3| 4| 5| 6| 7| 8| 9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|2
6|27|28|29|30|31)';
Please comment. Thanks!
I m trying to print the multiple lines to one base on certain pattern e.g.
Source:
Sun Feb 8 line1
line2
line3
Mon Feb 9 line4
line5
Tue Feb 10 line6
line 7
line 8
Target
Sun Feb 8 line1 line2 line3
Mon Feb 9 line4 line5
Tue Feb 10 line6 line7 line8
I can accomplish this using gawk b/c gawk allows regex to define RS, but can I use the same concept in PERL?
a2p translate it into below but it does not work,
$/ = '(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Dec|No
v) ( 1| 2| 3| 4| 5| 6| 7| 8| 9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|2
6|27|28|29|30|31)';
Please comment. Thanks!