If you know the .csv files are only buried, say, a max of 3 dirs deep then you can just do something like this:-
.csv
awk 'FNR==1,FNR==5 {printf("%s;%s\n",FILENAME,$0)}' *.csv */*.csv */*/*.csv */*/*/*.csv > output.csv
and that avoids a lot of the for/find fuckery.
for/find
(It'll complain to stderr if there are any directories that end in .csv but won't affect the output.)
stderr
@Greenbank started
London Fixed Gear and Single-Speed is a community of predominantly fixed gear and single-speed cyclists in and around London, UK.
This site is supported almost exclusively by donations. Please consider donating a small amount regularly.
If you know the
.csv
files are only buried, say, a max of 3 dirs deep then you can just do something like this:-and that avoids a lot of the
for/find
fuckery.(It'll complain to
stderr
if there are any directories that end in.csv
but won't affect the output.)