----- Original Message -----
From: "Naresh Bajaj" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, March 11, 2006 8:49 PM
Subject: Removing the blank spaces
Hello,
This is my problem. I have extracted one variable value from a file and
saved it another fie.
Problem is that it has too many spaces as shown in this example. I want to
remove those blank spaces.
If I use split, / / $fti, I am getting partial results as shown below.
Please let me know how can I remove those spaces. I appreciated.
Example:
Here is the output saved file looks like:
! fti =
240
Use regexp.
$x = "a b c d\n12 3\n\nA B C";
$x =~ s/\s+/ /sg;
$x =~ s/^\s*(.*?)\s*$/$1/s;
print ":$x:;
:a b c d 12 3 A B C:
Petr Vileta, Czech republic
(My server reject all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs