jisha
1
hi,
i have a file of the below format:
WA| 3|52|Waste |
PW| 3|53|Promotion Waste |
BR| 3|54|Breakage |
TH| 3|55|Theft |
IC| 3|56|Insurance Claim |
I want to replace the last delimiter | by using sed command ...can u please help me witht this
Thanks in advance
Js
vino
3
Replace the last delimiter with what ? Or are you looking to remove it altogether.
sed -e "s/\(.*\)|/\1/g" input.txt
or
sed -e "s/\(.*\)|/\1 DELIMITER_REPLACED_WITH_THIS_STRING/g" input.txt
jisha
4
Thanks a lot vino .
I wanted to replace the last with space ... Sorry for not mentioning
Js
jisha
5
thanks a lot for the answer quintet
It worked out perfect
Js