Click here to Skip to main content
15,900,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I need to create a routine download of some databases that come from the internet (company system), but when downloading I need to perform some manipulations on the files and always save to a fixed network address (overwrite the old ones)

How do I make it automatic? I have no idea how to do it, python itself I don't know if it can be used on the machine due to company restrictions, but anyway, put the alternatives and I will test them all.

What I have tried:

I have little knowledge in programming, but I think this solution is not very complex
Posted
Updated 16-May-23 7:27am

1 solution

Quote:
when downloading I need to perform some manipulations

You can't!

You need to:
- download[^] a file on local computer,
- perform some calculations,
- save file to fixed network address.

See:
Python
import urllib.request
urllib.request.urlretrieve('http://www.yourcompanysite.com/data/Excel1.xlsx', 'Excel1.xlsx')


Another example:
Python
import requests as req

remote_url = 'http://www.yourcomapnysite.com/Excel1.xlsx'
local_file_name = 'Excel1.xlsx'

data = req.get(remote_url)

with open(local_file_name, 'wb')as file:
    file.write(data.content)


To be able to read and modify Excel data, you have so many options... You forgot to mention what kind of manipulations you want to make on downloaded files, so i can't help you more.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900