- You can select a given column from a
csv
file using the commandcut
. Then,- The column name is going to be in the first line (header); access it with
head
- The number of distinct values can be found by counting the number of lines when you have sorted them and removed duplicates (using a combination of
tail
,sort
anduniq
) - The minimum and maximum values can be found by combining
sort
andhead
(ortail
) - To write the script, use the generic placeholders
$1
and$2
for the file name and column number, respectively
- The column name is going to be in the first line (header); access it with