The UNIX and Linux Forums
>
Top Forums
>
UNIX for Dummies Questions & Answers
How to remove extraneous character
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
How to remove extraneous character
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
03-11-2008
ShawnMilo
Registered User
Join Date: Jun 2006
Posts: 252
To strip off the last character:
echo "1.39," |
perl
-pe 's/.$//'
Output: 1.39
If you only want to strip off a comma and ignore anything else, replace the period in that regex with a comma.
ShawnMilo
ShawnMilo
View Public Profile
Find all posts by ShawnMilo
Find ShawnMilo's past nominations received
Find ShawnMilo's present nominations given