How to remove commas at the end of rows
I would like to remove commas , at the end of each line in my file.
sed only remove the last comma character, but I would like to remove all the commas (and maybe all other character, like:::) at the end of a lines. My command: sed 's/,$//' file for example my file contains: Solaris, Debian,,,,, Kubuntu,, Unix,,,,,,,, Apache::: Thanks in advance. |
Pretty straightforward.
Code:
sed 's/,*$//' file # remove all trailing commas |
Thank you very much.
|
sorry. mixed up the patterns.
|
Old style sed regex using () instead of [], removing all trailing commas and colons:
Code:
sed 's/\(,\|:\)*$//' input |
All times are GMT -5. The time now is 04:54 AM. |