how to count the row amount of a file and get header and footer with empty row in unix script
Posted on 2011-09-07
There is 1 file FILE.txt , use unix script to get the header and footer rows, count the row amount except header and footer
1204 500 5 435 46509 65 90650
i) There maybe is empty row after the footer
ii)check the header 8 position must be "A"
iii)check the footer 10-13 value must equal the row count amount of the file except the header and footer
head -n 1 FILE.txt , can get the header
but tail -n 1 FILE.txt can NOT get the correct footer
any advice ?