Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: to copy certain content in file & repeat it .

by harshmane (Initiate)
on Jun 30, 2011 at 09:16 UTC ( #912128=note: print w/ replies, xml ) Need Help??


in reply to Re: to copy certain content in file & repeat it .
in thread to copy certain content in file & repeat it .

#! /usr/bin/perl use warnings; open (FF,"src.txt"); # fro where i have to read. open (FF1,">dest.txt"); # while (<FF>) { $lin=$_; print FF1 $lin; if (/input/) # input i a word after dat all paragraph shud be copied + till other wor is not encounterd diz word is #repeated is present tw +ice in given file {$i=0 while(<FF>) { @arr =$_; print FF1 @arr; $i++; exit if ($arr =~/term/); } } } while (<FF>) { for ($j=0;$j<$i;$j++) { print FF1 @arr[$j]; } }


Comment on Re^2: to copy certain content in file & repeat it .
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2015-07-02 01:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (25 votes), past polls