This post is in reference to http://www.unix.com/shell-programming-scripting/137977-tricky-sed-awk-question-post302428154.html\#post302428154
I am trying to go the opposite direction now:
I have the following file:
a,b,C,f,g
a,b,D,f,g
a,b,E,f,g
h,i,J,k,l
m,n,O,t,u
m,n,P,t,u
m,n,Q,t,u
m,n,R,t,u
m,n,S,t,u
v,w,X,z,a
v,w,Y,z,a
I want to use sed or awk (perl also welcome), to "condense" these lines into this format:
a,b,C-D-E,f,g
h,i,J,k,l
m,n,O-P-Q-R-S,t,u
v,w,X-Y,z,a
Who is up for it? You would again save me tons of time!
Thanks a lot in advance!