Suppose you have a set of files you want to partition on the basis of the first line in the file.
This script enables you to move a filtered subset (based on the header line) to a target directory.
You specify the pattern in the first line of the files you wish to move. Those files containing the pattern in their header get moved, those without don’t.
head_move.sh PATTERN FILES... DIR
/surveys
a.tsv
b.tsv
c.tsv
d.tsv
.
.
.
/standard
/extended
head_move.sh "Q14" *.tsv extended