Need for the command occurred when I wanted to skip first line of file as I didn't want to the column descriptions, only the values.
I filtered the company ids by first downloading the csv file from https://www.avoindata.fi/data/fi/dataset/yritykset.
and then executing the command:
head 2024-08-14_full_prh_data.csv | awk 'BEGIN {FS=";"} {print $2}' | tail -n +2 > yritystunnuksia.txt
head prints first ten lines of file. awk command prints only the second column of each line. Tail -n +2 prints lines starting from second line.
Some other options for filtering first line could be found from https://stackoverflow.com/a/71968857/18165446
Comments