Platform: Oracle Linux 6.5
I have a file with hundreds of values enclosed in single quotes like below. I want the trailing empty spaces before the ending quote to be removed. Expected output shown below. Can this be done using good old vi editor ? Or should I use sed or awk for this ?
Note : unix.com's editor is not working well with my Firefox or Chrome browser. Because of this , I see a preceeding space before 'ABC' in the 'Exprected output' . Please ignore this.
Hi kraljic,
As to your question of whether or not this can be done "using good old vi editor", the answer is yes. The command:
:g/ *'$/s//'/
will do it. And, of course, this also means that if you're using the good old ed or ex editors, you can also accomplish the same thing with the command: