Data formatting using awk

Need assistance on the data extraction using awk

Below is the format and would like to extract the data in another format

-------------------------------------------------------------------------------------------------
 Minimum Temperature (deg F [tenths deg F for monthly])
 DAY  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31  MONTH
-------------------------------------------------------------------------------------------------
JAN  36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36    360
FEB  37 37 37 37 37 37 37 37 38 38 38 38 38 39 39 39 39 39 40 40 40 40 41 41 41 41 42 42             389
MAR  42 43 43 43 43 44 44 44 45 45 45 45 46 46 46 46 47 47 47 47 47 48 48 48 48 49 49 49 49 49 50    462

36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36

Need only the number inside the table . any idea are appreciated

What have you tried?

Although Jotne asks you for your own (partial) solution, and although me too, I encourage you to develop it on your own, here an example of how it might look like:

awk '{$1=$NF="";$0=substr($0,2,length($0)-2)} NR>4' OFS="," file
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36
37,37,37,37,37,37,37,37,38,38,38,38,38,39,39,39,39,39,40,40,40,40,41,41,41,41,42,42
42,43,43,43,43,44,44,44,45,45,45,45,46,46,46,46,47,47,47,47,47,48,48,48,48,49,49,49,49,49,50
1 Like

try also:

awk '$NF+0 {sub($1 "  *", ""); NF--; $1=$1; print}' OFS=", " input
1 Like

Thanks a lot rdrtx1, RudiC for giving some inputs they really help me .!!!