shell_scripting
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
shell_scripting [2023-09-21 05:10 pm] – hcho | shell_scripting [2023-09-21 05:15 pm] (current) – hcho | ||
---|---|---|---|
Line 49: | Line 49: | ||
</ | </ | ||
+ | ===== Counting non-null records in a column in a CSV file ===== | ||
+ | |||
+ | <code bash> | ||
+ | tail -n +2 merged.csv | | ||
+ | sed ' | ||
+ | awk '{ | ||
+ | if($57 != "" | ||
+ | count++ | ||
+ | } | ||
+ | END{ | ||
+ | print count | ||
+ | }' | ||
+ | </ |
shell_scripting.1695337829.txt.gz · Last modified: 2023-09-21 05:10 pm by hcho