Hi All,
I have the following requirement. In a directory i get files from external source. I at regular intervals check that directory for any incoming files.
The file name is underscore delimited.
Such as:
aaa_bbb_ccc_ddd_eee_fff.dat
I am using awk and and splitting the file name.
But now we are getting files with an extra parameter too.
aaa_bbb_ccc_ddd_eee_fff_ggg.dat
so there may be a combination of files with diferent field counts. So i am unable to parse the file name coz i dont know the exact field count as it may change for different file names
.
I googled and i found out that optional parameters can be made use of in GAWK. But i need to know how to do it using awk. Any alternative apart from GAWK, awk(if not possible using awk) is also welcomed. Any help would be greatly appreciated.