On 5/18/06, Gerald Wheeler [EMAIL PROTECTED] wrote:
Wondering how I can insert a value: abc| w/o the quotes) immediately
after the third | (pipe character) in file xyz.txt.
There's more than one way to do it. One way would be a substitution
(s///). Another would be to use split and join:
Hi,
As Tom Phoenix said there are many ways to do it, this is one of the way we can
do it.
+++
$string =
one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|;
$added = abc|;
@tmp_array = split(/\|/,$string,4);
for ($i=0;$i$#tmp_array;$i++)
{
Saboo, Nandakishore wrote:
Hi,
Hello,
As Tom Phoenix said there are many ways to do it, this is one of the way we
can do it.
+++
$string =
one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|;
$added = abc|;
@tmp_array =