In a parent directory, I have several sub-directories, each of them contain one or more space-delimited text files.
I have the following command that outputs what I want, but only for an individual file INPUTFILE.txt
awk '{if (NF>4){print $1, $2, $3 , "0" } else {print $0}}' INPUTFILE.txt
Considering the fact that I have thousands sub-directories, and the file names will vary, how can I apply this command to all sub-directories; from the parent directory?
each of them enclose a table
. Do you mean every directory contains a tab-delimited file? 2. In each directory is there always only one file, and always namedINPUTFILE.txt
or could there be one or more files with a variety of file names?