I have a file and I want to reverse all word in it.
ex input file:
DCBA. HGFE.GI
MLK,PON.RQ
UTS. ZYXWV. 321
ex output file: (What I Want)
ABCD. EFGH.IG
KLM,NOP.QR
STU. VWXYZ. 123
With this sed script: sed '/\n/!G;s/\(.\)\(.*\n\)/&\2\1/;//D;s/.//'
all the entire line is reversed.
The wrong output produced by the command above:
IG.EFGH .ABCD
QR.NOP,KLM
123 .VWXYZ .STU
How can I get my desired output?
.
in his second line of input.