I was humouring your weird way of doing things, but it doesn't scale. Split the input into fields, edit the fields you want
perl -lape' $F[1] =~ s{\|([^|]*)\|([^|]*)}{<name>$1</name><value>$2</value>}; $F[2] =~ s{\|([^|]*)\|([^|]*)}{<foo>$1</foo><bar>$2</bar>}; $_ = join("\t", @F); ' inputfile
In reply to Re^4: Recursive substitution difficulties
by ikegami
in thread Recursive substitution difficulties
by wx27
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |