julia <> writes:
> On 1 oct, 11:52, Tad J McClellan <ta...@seesig.invalid> wrote:
>> julia <julia_2...@hotmail.com> wrote:
>> > How to make this command search and replace xtimes.
>> > perl -p -i -e 's/oldstring/newstring/g' file.txt
>>
>> That depends on what "xtimes" means.
>>
>> What does "xtimes" mean when you say it?
>>
>> xtimes per line?
>>
>> xtimes per file?
>>
>> x lines per file?
>>
>> ...?
>>
>> --
>> Tad McClellan
>> email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
>
> I want to take 4times oldstring and replace it with newstring1
> I want to take 3times oldstring and replace it with newstring2
> oldstring
> oldstring
> oldstring
> oldstring
> oldstring
> oldstring
>
> newstring1
> newstring1
> newstring1
> newstring1
> newstring2
> newstring2
> newstring2
What if oldstring appears more than once on a line?
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"