Article 5RXAE tail help

tail help

by
sean mckinney
from LinuxQuestions.org on (#5RXAE)
As an addition to what I was doing / am doing in https://www.linuxquestions.org/quest...54#post6299554

I want to output the last 20 lines of all the csv's in one folder to a csv in another folder.

I think

tail -n 20 *.csv > folder2/last-20s.csv

works beautifully, I am currently using a windows computer and can't check the actual command I wrote, hence "I think".

But, in the process of writing each qualifying line to last-20s.csv, I would like to, if possible, add
1) the count for total number of lines in all the csv's processed to that instant.
2) the count for number of lines processed to that instant in the individual csv being processed.
3) the name of the individual csv being processed.

If the terminology is applicable to "tail" the above might amount to NR, FNR and FILENAME.
If relevant and necessary, I would be using awk or gawk as it/they is/are the only programming language/s with which I have any familiarity.
For reference there are 2000+ csv's being scanned with a total of well over 4,000,000 lines.
Any help would be gratefully received.latest?d=yIl2AUoC8zA latest?i=A1TkA2zqvv4:sXeVwZxG7is:F7zBnMy latest?i=A1TkA2zqvv4:sXeVwZxG7is:V_sGLiP latest?d=qj6IDK7rITs latest?i=A1TkA2zqvv4:sXeVwZxG7is:gIN9vFw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments