# How to calculate the standard deviation for each row?

I have file of 61 columns; I would like to calculate the standard deviation (SD) for each row with ignoring the 1st column and print the results against the 1st column, please note that the number of columns is not the same for each row and also some rows have only values for the first column which is not including in calculating the SD

``````input file
0.0  4  6  5  1  2  9  4  5  1  .....
0.5  3  1
1.0  3  7  8  2
1.5  3  3  3  4  6  4  5
2.0
2.5  6  7  6  9
``````
• Off-topic, big time. Jul 14, 2016 at 21:43
• @Cbhihe Sounds like a homework question to me. Jul 14, 2016 at 21:47
• @Cbhihe No, not really. It's a bit more involved than our average data processing question but not wildly off-topic. It may be a duplicate: Moshen, do check our existing questions. Jul 14, 2016 at 23:07
• @Gilles: My interpretation (may be off) if that this has litterally nothing to do with *nix. Sure, it can be answered here, as it is... so perhaps in that sense is it not really off-topic. However it remains a sideline topic just holding by the one thread, we call ... `awk`. Maybe not fully "off-topic" but definitely on the wrong side of "borderline" (at best) ... Jul 15, 2016 at 7:15

``````awk 'NF>1{ s=0;s2=0;c=NF-1 ;
• @MohsenEl-Tahawy Are you trying to get us to do your homework for you? The answer is already 99% of what you asked for; surely you can go the final 1% on your own. Try reading the `awk(1)` man page as suggested, or perhaps read Apple’s tutorial. Jul 14, 2016 at 21:57