I have a folder called PKA1Within this folder I have several folders named as:1eV, 2eV .... 30eVWithin each of these subfolders I have a file called PKA.dumpI want to copy the 20th line of PKA.dump in each subfolder to a file called data.txt.I know I can use the find command to find all PKA.dump files as:find . -type f -name PKA.dumpI also know I can write individually with sed:sed -i '20q;d' PKA.dump > data.txtBut when I try to loop through all files and use sed such as:find . -type f -name PKA.dump | sed -i '20q;d' PKA.dump > data.txtI get this error:sed: can't read PKA.dump: No such file or directoryAny help? I just want to sequentially have the 20th line from PKA.dump in file 1eV, 2eV, 3eV etc in a file called data.txt.
Using find and sed to copy 20th line of many files into one file
shell script;text processing;files;find