Find all files named _somethingsomething_ yy _somethingsomething_ .csv
in all folders named xx
and get all of the data from the second row of each file.
cat "`find . -type d -iname "xx" | find . -type f -iname "*yy*csv" | head -1`" | sed -n 1p > SummaryOfYY.csv;
find . -type d -iname "xx" | find . -type f -iname "*yy*csv" -exec sed -n 2p {} \; >> SummaryOfYY.csv
The first line above gets the header from the first file.
The second line above grabs the second row from the files and adds it to the SummaryOfYY.csv
file.