F
fred
Thanks sln from @netherlands.com/
xxxx&(ght)(hgf)&&(yyt)
xx9x&(gg)(ff)&&(yyt)
oixxx&(hfd)(jj)&&(yyt)
xxxx&(jj)(kk)&&(yyt)
xjhxxx&(jj)(j)&&(yyt)
xjhxxx&(jj)(j)&&(yyt)
xjhxxx&(jj)(j)&&(yyt)
This command is working. I can change && for foo1 and foo2.
perl -0 -pe 's(&&)(++$n < 2 ? "&foo1&" : "&foo2&")eg' text.txt
Please explain to me why the command is not working for foo3.
perl -0 -pe 's(&&)(++$n < 2 ? "&foo1&" : "&foo2&" : "&foo3&" )eg'
text.txt
Thanks
xxxx&(ght)(hgf)&&(yyt)
xx9x&(gg)(ff)&&(yyt)
oixxx&(hfd)(jj)&&(yyt)
xxxx&(jj)(kk)&&(yyt)
xjhxxx&(jj)(j)&&(yyt)
xjhxxx&(jj)(j)&&(yyt)
xjhxxx&(jj)(j)&&(yyt)
This command is working. I can change && for foo1 and foo2.
perl -0 -pe 's(&&)(++$n < 2 ? "&foo1&" : "&foo2&")eg' text.txt
Please explain to me why the command is not working for foo3.
perl -0 -pe 's(&&)(++$n < 2 ? "&foo1&" : "&foo2&" : "&foo3&" )eg'
text.txt
Thanks