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]; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: to copy certain content in file & repeat it .
by roboticus (Chancellor) on Jun 30, 2011 at 10:10 UTC | |
|
Re^3: to copy certain content in file & repeat it .
by Anonymous Monk on Jun 30, 2011 at 09:36 UTC | |
|
Re^3: to copy certain content in file & repeat it .
by Anonymous Monk on Jun 30, 2011 at 10:39 UTC | |
by harshmane (Initiate) on Jul 01, 2011 at 09:27 UTC | |
by Anonymous Monk on Jul 01, 2011 at 10:02 UTC | |
by harshmane (Initiate) on Jul 01, 2011 at 10:55 UTC | |
by Anonymous Monk on Jul 01, 2011 at 11:20 UTC | |
|
Re^3: to copy certain content in file & repeat it .
by harshmane (Initiate) on Jun 30, 2011 at 09:42 UTC | |
by Anonymous Monk on Jun 30, 2011 at 10:13 UTC |