M Z wrote:
> hello all -
>
> I am trying to do the following to this data:
> input:
> X|YZ||A
>
> desired output:
> X|Y| | | |Z| |A
>
> simply replacing || with | |
> whereever it may occur in the string.
>
> This bit of code doesn't seem to do all of the job.
>
> What is wrong with this code?
Tim Johnson wrote:
>
> I'm not really giving you the answer you're looking for, but here is one way
> to go about it:
>
> while(<>){
> my @temp = split(/\|/,$_);
> foreach my $item(@temp){
> if($item eq ''){
> $item .= ' ';
> }
> }
> print join('|',@temp);
> }
Or you could
CTED]
Sent: Thursday, June 12, 2003 5:28 PM
To: [EMAIL PROTECTED]
Subject: Re: misunderstanding the /g modifier on REGEX
M Z wrote:
hello all -
I am trying to do the following to this data:
input:
X|YZ||A
desired output:
X|Y| | | |Z| |A
simply replacing || with | |
whereever it may occur in
To: [EMAIL PROTECTED]
Subject: Re: misunderstanding the /g modifier on REGEX
M Z wrote:
> hello all -
>
> I am trying to do the following to this data:
> input:
> X|YZ||A
>
> desired output:
> X|Y| | | |Z| |A
>
> simply replacing || with | |
> whereever it may oc
Original Message-
From: M z [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 12, 2003 3:35 PM
To: [EMAIL PROTECTED]
Subject: misunderstanding the /g modifier on REGEX
hello all -
I am trying to do the following to this data:
input:
X|YZ||A
desired output:
X|Y| | | |Z| |A
simply replacing ||
M Z wrote:
> hello all -
>
> I am trying to do the following to this data:
> input:
> X|YZ||A
>
> desired output:
> X|Y| | | |Z| |A
>
> simply replacing || with | |
> whereever it may occur in the string.
>
> This bit of code doesn't seem to do all of the job.
>
> What is wrong with this
hello all -
I am trying to do the following to this data:
input:
X|YZ||A
desired output:
X|Y| | | |Z| |A
simply replacing || with | |
whereever it may occur in the string.
This bit of code doesn't seem to do all of the job.
What is wrong with this code?
while (<>) {
while($_ =~ /([|])([|
hello all -
I am trying to do the following to this data:
input:
X|YZ||A
desired output:
X|Y| | | |Z| |A
simply replacing || with | |
whereever it may occur in the string.
This bit of code doesn't seem to do all of the job.
What is wrong with this code?
while (<>) {
while($_ =~ /([|])([|