Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: find the string in the file and print its subsequent strings

by Discipulus (Canon)
on Apr 20, 2020 at 15:37 UTC ( [id://11115833]=note: print w/replies, xml ) Need Help??


in reply to find the string in the file and print its subsequent strings

Hello saro and welcome to the monastery and to the wonderful world of Perl!

to make a program you must have a plain solution to then translate it into a program. Let's see:

open a file named DATA.TXT read all lines of this file if the string 'NINE' is found save the whole string for later use -or (not clear in your question)- if the string 'NINE' is found split this string into 8 parts close the file print the result

useful reads:

Try some code on your own and post your code and questions here.

Dont forget to start your program with:

use strict; use warnings;

You can also add use diagnostics; after the above lines to get more help from Perl itself

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: find the string in the file and print its subsequent strings
by saro (Initiate) on Apr 23, 2020 at 17:39 UTC

    Thanks for this inputs. I will try my own code and learn from there

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11115833]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-16 23:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found