Is this a homework assignment? Homework and coursework questions can only be posted in
the homework & coursework forum under
special homework rules.
Whether or not this is homework, you need to provide a MUCH better description of what you are trying to do if you want help writing a script to do it.