Hi asta,

Try this:
#!/usr/bin/perl -w
use strict;

$_="ka''''''''''''''ielsi''''oil''aso\n";
print;
s/'{2,}/""/g;
print;

# or
$_="'Line Items'!D14=0,'','Line Items'!D14\n";
print;
s/''+/""/g;
print;

samson

-----Original Message-----
From: asta [mailto:[EMAIL PROTECTED]
Sent: Friday, October 17, 2003 9:58 AM
To: ActivePerl
Subject: How to replace '' with "" ?


Hi,

I have parsed formula from XML like:
=IF('Line Items'!D14=0,'','Line Items'!D14)

I need it look like this:
=IF('Line Items'!D14=0,"",'Line Items'!D14)


This looks like founds '' (prints $count = 1):

  while ($strng =~/\'\'+/g) { $count++ }

  print $count, "\n";
 print $strng;

But s/// doesn't replace '' with "" for me ("Use of uninitialized value in
substitution (s///)...

  if ($count > 0) {
    $strng= ~s/\'\'+/\"\"+)/g;
   }

Looking forward for community advices :)

Thanks,
Asta

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to