Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: How to add a new line after three or four lines from a pattern after getting that pattern

by thanos1983 (Parson)
on Apr 03, 2019 at 11:47 UTC ( #1232085=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to add a new line after three or four lines from a pattern after getting that pattern
in thread How to add a new line after three or four lines from a pattern after getting that pattern

Hello again anirbanphys,

See the updated version that contains solution to the hard-coded problem. Now the script will pick up the string withing the interesting line.

Hope this helps. Let me know if you can not understand what the code does.

BR / Thanos

Seeking for Perl wisdom...on the process of learning...not there...yet!
  • Comment on Re^3: How to add a new line after three or four lines from a pattern after getting that pattern
  • Select or Download Code

Replies are listed 'Best First'.
Re^4: How to add a new line after three or four lines from a pattern after getting that pattern
by anirbanphys (Beadle) on Apr 03, 2019 at 11:53 UTC

    SURE !!! Yes I just got the code :D. And it is working. I commented the unwanted section. One Last help, how to get rid of from extra characters from the output? Do I have to parse again to delete the extra characters?

      Hello again anirbanphys,

      I do not know what extra characters from the output you are referring? If you mean the single quotes '' in the output it simply how Data::Dumper prints the output. If you want you can use alternatively:

      use feature 'say'; say $_ for @lines;

      Otherwise give me more information regarding the characters you want to remove. BR / Thanos

      Seeking for Perl wisdom...on the process of learning...not there...yet!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2020-06-07 06:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (42 votes). Check out past polls.

    Notices?