bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: List out


From: strombrg
Subject: Re: List out
Date: Sat, 13 Feb 2016 18:32:30 -0800 (PST)
User-agent: G2/1.0

I'd do this like:

#!/bin/bash

python -c '
import sys
for line in sys.stdin:
    fields = line.split()
    count =0
    for field in fields[1:]:
        upper = field.upper()
        print(upper)
        if upper == "NA":
            count += 1
    print("{} {}".format(fields[0], count))
'


reply via email to

[Prev in Thread] Current Thread [Next in Thread]