Hello UNIX experts,
I have 124 text files in a directory. I want to extract the 45678th line of all the files sequentialy by file names. The extracted lines should be printed in the output file on seperate lines.
e.g. The input Files are one.txt, two.txt, three.txt, four.txt
The cat of four files are
one.txt
AAAA
BBBB
CCCC
DDDD
two.txt
1111
2222
3333
4444
three.txt
aaaa
bbbb
cccc
dddd
four.txt
bcde
cdef
defg
efgh
The desired output in output.txt is (3rd line of all files one by one on seperate lines. Keep 6 spaces and print the filename at the end)
CCCC one.txt
3333 two.txt
cccc three.txt
defg four.txt
Thanks in advance.