Search Results

Search: Posts Made By: sprinner
20,521
Posted By bartus11
As for the "\1", it stores the first match...
As for the "\1", it stores the first match contained in "()" brackets. To modify your file directly use this: perl -i -0pe 's/Raining(.*\n.*TODAY)/Sunny\1/g;s/(TODAY.*\n.*)Reading/\1Hiking/g' file
20,521
Posted By Skrynesaver
man perlrun -p causes Perl to assume the...
man perlrun
-p causes Perl to assume the following loop around your program, which makes it iterate over filename arguments somewhat like sed:
LINE:
while (<>) {
... ...
20,521
Posted By bartus11
Try: perl -0pe...
Try: perl -0pe 's/Raining(.*\n.*TODAY)/Sunny\1/g;s/(TODAY.*\n.*)Reading/\1Hiking/g' file
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 08:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy