fixed tidy options with forced-output for last section; removed empty entries at the end with an if inside awk