in reply to Extract information from text file

If you care to learn, please research. If not - try to use this, hopefully, to learn
perl -ane 'm/^total/ ? shift @F:$.==1 or next; print join(",",@F),"\n" +' INPUT-FILE-NAME.TXT
Now that you have a solution, hopefully, it generates interest, and specific questions you can ask here.

        "You're only given one little spark of madness. You mustn't lose it."         - Robin Williams