R
Ross
I have the following directories under a dir called raw data-1, and under
each subdir, say, 4601-4.SMP, there is a single file under there. indeed
that single file has a fixed format and i'm going to extract numerical
values there to write to a new file along with two from 4601-4B.SMP and
4601-4C.SMP. Since a user does not follow nomenclature strictly, sometimes
he names a dir, say, 4601-4A.SMP instead of 4601-4.SMP, how could i achieve
extracting 3 files and write to a single file? Finally i would find the
average of the numerical values obtained from the 3 files.
admin/home/admin> ls -al raw\ data-1/
total 96
drwxr-xr-x 23 admin admin 4096 Aug 20 03:59 .
drwxr-xr-x 9 admin admin 4096 Aug 20 03:59 ..
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4594-3.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4594-3B.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4594-3C.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4601-4.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4601-4B.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4601-4C.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4605-5.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4605-5B.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4605-5C.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4612-2.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4612-2B.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4612-2C.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4614-6.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4614-6B.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4614-6C.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4618-1.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4618-1B.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4618-1C.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4620-1.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4620-1B.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4620-1C.SMP
each subdir, say, 4601-4.SMP, there is a single file under there. indeed
that single file has a fixed format and i'm going to extract numerical
values there to write to a new file along with two from 4601-4B.SMP and
4601-4C.SMP. Since a user does not follow nomenclature strictly, sometimes
he names a dir, say, 4601-4A.SMP instead of 4601-4.SMP, how could i achieve
extracting 3 files and write to a single file? Finally i would find the
average of the numerical values obtained from the 3 files.
admin/home/admin> ls -al raw\ data-1/
total 96
drwxr-xr-x 23 admin admin 4096 Aug 20 03:59 .
drwxr-xr-x 9 admin admin 4096 Aug 20 03:59 ..
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4594-3.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4594-3B.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4594-3C.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4601-4.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4601-4B.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4601-4C.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4605-5.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4605-5B.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4605-5C.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4612-2.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4612-2B.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4612-2C.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4614-6.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4614-6B.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4614-6C.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4618-1.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4618-1B.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4618-1C.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4620-1.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4620-1B.SMP
drwxr-xr-x 2 admin admin 4096 Aug 20 03:59 4620-1C.SMP