How to count the records except header and footer in a sequential file

I have a sequential file it is having some records and the same file is having header and footer now my question is how to count the records in a file which is not counts the header and footer records and then transform the records in to target and then again we fetch the header and footer to that file which records are matched with the header

Showing Answers 1 - 1 of 1 Answers

Sasidhar Punna

  • Oct 24th, 2018

cat | sed 1d ; $d | wc -l
sed 1d --- for removing 1st row
sed $d ---- for removing last row

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions