I've to make a space seperated data information to "
-" delimited. If the fields were fixed I can use:
Code:
awk '{print $1"-"$2"-"$3"-"$4"-"}' final.txt
having four fields.
but how can I do the same when the fields are variable in every rows.
Suppose:
Quote:
AAA BBB CCC
UUU TTT III OOO
RRR SSS PPP GGG HHH
BBB MMM
|
required o/p:
Quote:
AAA-BBB-CCC
UUU-TTT-III-OOO
RRR-SSS-PPP-GGG-HHH
BBB-MMM
|