I have multiple text files with different data, but same header & bottom text. I have to remove the header and tail text and merge them into one output file. Any one liner with decent speed would be good. All of the file names Start with the name ABC, and are in the same directory.
Example File1:
This is a sample header
This is Not required
I have to remove this data
....... DATA of file 1 .........
This is sample tail
It needs to be removed
Example File2:
This is a sample header
This is Not required
I have to remove this data
....... DATA of file 2 .........
This is sample tail
It needs to be removed
I am using
head -n -12 ABC.txt | tail -n +20 > output.txt
but it processes only 1 file. (12 lines to be removed from bottom, 20 to be removed from top)