hi guys
how can i add spacein file name with sed if strings have no space around dash
input
19-20
( 18-19 )
ABC-EFG
output after add white space
19 - 20
(18 - 19 )
ABC - EFG
thx in advance
hi guys
how can i add spacein file name with sed if strings have no space around dash
input
19-20
( 18-19 )
ABC-EFG
output after add white space
19 - 20
(18 - 19 )
ABC - EFG
thx in advance
$ sed -e 's/\([^ ]\)-/\1 -/g' -e 's/-\([^ ]\)/- \1/' infile > outfile
awk '{gsub(/ /,x);gsub(/-/," - ")}1' file
19 - 20
(18 - 19)
ABC - EFG