Found it out.
In the Magento(1.8) Admin, go to the system ->configuration , then set the current configuration scope to main website, then go to the shipping method tab. in the shipping method tab, choose table rates, then set the condition to let's say "Weight vs Destination". Then set after setting additional options(depends on what you need), press the export button to download the csv. You may then modify the excel file based on the variables you need to compute the shipping rate. afterwards just press import to save the table rates to your configuration.
It took me a couple of days, plus I had to do some tinkering in the database(I need to have states if the country selected is Australia, so I had to manually insert them)