Wednesday 21 December 2011

Dynamic File Editing

Dynamic File Editing

I have a directory for every area code 200-999, and inside each directory is a directory for each prefix that we have added, and one file name 'prefixes' that contains one prefix per line like this '200,0,0,0,0,0,0,0,0'.

Right now every 'prefixes' file contains prefixes 200-999, but if we try to enter a phone number without the prefix directory it crashes the system.

So, I need a script to check each area code directory and remove all the prefix lines from the 'prefixes' file that don't have a corresponding prefix directory.

I hope this makes sense, I am completely lost and desperate for help.

No comments:

Post a Comment