Hi,
I am trying to write a script for following scenario:
I have a
list of countries from where I receive files...eg. (Indonesia, Thailand, Australia...etc)
For each country, I have a
list of files that they send.
IND -- a,b,c
TH -- p,q,r
AU -- x,y,z
The path for these files could be common, or exclusive to a particular country.
For each country, I also have a
list of holidays. eg.
IND - Jan 1 , May 1
TH - Jun 20, May 1
AU - Dec 25 , Oct 21..
For these holidays, I also have an exclusion list.
So, even if it's a holiday, say for TH, we would still get files p & r (not q) - and this rule is valid for all holidays in TH. Similarly for other countries.
I need to do the following:
- Loop through the countries
- For each country check if current day is a holiday
- If not a holiday, check if file exists
- If it's a holiday for a particular country, check the exclusion list, and determine if the holiday files have arrived.
- Have a detailed output such as:
Country Filename Date Comments
TH p 6/20 Received
TH q 6/20 not expected, as Holiday
TH r 6/20 expected - but not received !
Challenges that I am facing:
- How do I maintain the static data?
- For list of countries I can have a txt file
- For Holidays, should I have a csv file
- Can I include, all info in a csv file? If yes, how should it be structured?
Would appreciate if people can share best practices, or give me some pseudo code/ code or pointers...Any help is much appreciated.
This needs to be a .ksh or a maybe a perl script. I am thinking perl, because I may be able to organise the data as an array.
Thanks!