I use an application called Easy-IP to keep track of IP utilization. Underneath lies a Firebird database, which I've extracted to CSV. The header line lists all the columns, but I wanted to know the array index for processing. Short of counting commas, I came up with:
head -1 ./current.csv |perl -ane '$i = 0; s/\,/" ".$i++."\n"/eg; print
The header line looks like so:
My output, abbreviated:
I bet the brains at PM can do better. Suggestions?