Bash Scripting, looping through subdirectories to create 1 and 0 column of values
Hello, everybody, I have several subdirectories which contains several files with .SAC extension, for example
folder01
01.SAC
02.SAC
04.SAC
Notice 03.SAC is missing.
folder 02
02.SAC
03.SAC
04.SAC
Notice 01.SAC is missing
So, what I need is.. for every missing file display a 0, otherwise display 1
For example
from folder01 I need a simple text file (lets say file01.dat)with a column with the following:
1
1
0
1
Similarly for folder02 I need (file02.dat)
0
1
1
1
And if possible merge all this, like:
finalfile.dat
1
1
0
1
0
1
1
1
Is there a way to do this????
Thanks!!
|