All pastes #280780 Raw Edit

Anonymous

public shellscript v1 · immutable
·published 2006-12-16 04:16 UTC
rendered paste body
#!/bin/awk{   count=ind=1   chapters[ind]=$1   for(i=2;i<=NF;i++){	    if($i>$count)			   chapters[ind]=chapters[ind]" "$i			else			   chapters[++ind]=$i			count++   }	 for(chapter in chapters)	    printf"Chapter%d: %s\n",chapter,chapters[chapter]}Example:[%] awk -f script <<< "30 33.993 76.123 0.6 43.234 87.234 130.345"Chapter1: 30 33.993 76.123Chapter2: 0.6 43.234 87.234 130.345