I need a help. I am pretty new to the shell level programing. I was trying to split a long lines to a multiple lines with few conditions. I goggle for the code and found some snippets and tried to modified it but I got few strange problems too.
I have to split the lines if line is longer than 120 characters, then I have to separate it by adding "\" at the end of around 120th character. Note it can only separated at delimitation positions such as space or comma. And here is the code for that
if ( length($0) > 120 )
while(length(str) > 120)
for (m=1; m<=120;m++)
if( letter !=",")
# printf("%s\n",substr($0,i+1,j) );
if( letter !=" ")