while read LINE do echo ${LINE}|grep -qE "^,+" if [ $? -eq 0 ] then echo "${LINE}\c" else echo "\n${LINE}\c" fi done<input_file echo