saro has asked for the wisdom of the Perl Monks concerning the following question:
DATA.TXT ============== ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE TEN ELEVEN TWELEVE 12-MAR-2020 /net/slcnas22/scratch/domain_name +http://testurl/home username_pwd THIRTEEN FOURTEEN FIFTEEN SIXTEEN SEVENTEEN EIGHTEEN NINETEEN TWENTY
I have above file - data.txt. In that file, i need to find the string name "NINE" and need to print that string along with its next subsequent 8 strings.
Expected output:NINE TEN ELEVEN TWELEVE 12-MAR-2020 /net/slcnas22/scratch/domain_name http://testurl/home username_pwd
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: find the string in the file and print its subsequent strings
by Corion (Patriarch) on Apr 20, 2020 at 08:30 UTC | |
|
Re: find the string in the file and print its subsequent strings
by Discipulus (Canon) on Apr 20, 2020 at 15:37 UTC | |
by saro (Initiate) on Apr 23, 2020 at 17:39 UTC | |
|
Re: find the string in the file and print its subsequent strings
by kcott (Archbishop) on Apr 21, 2020 at 06:38 UTC | |
|
Re: find the string in the file and print its subsequent strings
by AnomalousMonk (Archbishop) on Apr 20, 2020 at 21:01 UTC | |
|
Re: find the string in the file and print its subsequent strings
by BillKSmith (Monsignor) on Apr 20, 2020 at 14:31 UTC |