Skip to content

Instantly share code, notes, and snippets.

@anton-rudeshko
Created February 18, 2018 13:04
Show Gist options
  • Save anton-rudeshko/65abce7252c059f8afd824a7262dd203 to your computer and use it in GitHub Desktop.
Save anton-rudeshko/65abce7252c059f8afd824a7262dd203 to your computer and use it in GitHub Desktop.
# В отчётах в CSV разделителем идёт точка с запятой, а не запятая
BEGIN {
FS=";"
}
# В первой строке ищем колонку с нужным именем и сохраняем её индекс
NR == 1 {
for (i = 1; i <= NF; i++)
if ($i == target)
column_idx = i
}
NR > 1 {
print int($column_idx)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment