[EMAIL PROTECTED] schreef:

> "sed 's/^[ \t]*//;s/[ \t]*$//' /tmp/file.txt > /tmp/filea.txt"

  perl -pe 's/^[ \t]+//; s/[ \t]+$//' /tmp/file.txt > /tmp/filea.txt

Alternative-1:

  perl -pe 's/^[[:blank:]]+//, s/[[:blank:]]+$//' /tmp/file.txt >
/tmp/filea.txt

Alternative-2:

  perl -ple 's/^\s+//, s/\s+$//' /tmp/file.txt > /tmp/filea.txt


To see the actual code, insert "-MO=Deparse " before the "-p".


Recognize that a '+' is better than a '*' here.

-- 
Affijn, Ruud

"Gewoon is een tijger."



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to