DevSupport
asked on
sed remove last character of file but not every last character
Hi Experts,
I am having trouble stripping only the last character and second last, of a variable
before sed:
107005075456+
1019918397440+
182400823296+
53550772224+
1810193428480+
+
expected result:
107005075456+
1019918397440+
182400823296+
53550772224+
1810193428480
we tried sed -e 's/\+$//' but its stripping all + but I want to get rid of only the last + and the one on the second last line
Could you please help!
I am having trouble stripping only the last character and second last, of a variable
before sed:
107005075456+
1019918397440+
182400823296+
53550772224+
1810193428480+
+
expected result:
107005075456+
1019918397440+
182400823296+
53550772224+
1810193428480
we tried sed -e 's/\+$//' but its stripping all + but I want to get rid of only the last + and the one on the second last line
Could you please help!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Alternatively add a number at the end, 0
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank You so much for helping!!