hi salvatore sorry, I’m using pycharm and this is the coding for that part:
> excel_file = u'*Personal SUR GUL EPT 20190103*'
> controller_file = u'*IPs Controladoras*'
> ip_plan_file = u'*IP PLAN South_2*'
> controller_Dict = LOAD_EXCEL_FILE(controller_file, "Sheet1", 1, "key1")
> ip_plan_Dict = LOAD_EXCEL_FILE(ip_plan_file, "Sheet2", 1, "key2")
> Site_2G_Dict = LOAD_EXCEL_FILE(excel_file,"Sheet3", 1, "key3")
>
> Base_Station_row_list = []
> Site_list = READ_TXT_FILE("site_list")
> for sites in Site_list:
> if sites not in Site_2G_Dict.keys(): # Check if SiteID exist in excel file
> print sites, "Not present in Personal excel file"
> continue
>
> Site_2G_Info = Site_2G_Dict[sites]
> h = Site_2G_Info[0].attr("Site ID")
>
> # Device IP Address info
> for device_ip in ip_plan_Dict:
> if device_ip != h: continue
> device_ipplan_info = ip_plan_Dict[device_ip]
> i = device_ipplan_info[0].attr("IP Address")
> x = len(i)
this is the flow:
upload all the necessary excel files that contain all my info: excel_file, controller_file, and ip_plan_file.
from excel_file I take a key named Key3 this will be the main key that I will use to get other info in another column in the same excel related to that key, for example, Site ID = key4.
`h = Site_2G_Info[0].attr("Site ID")`
then with the key4 already identified I will use it to get some IP info inside of the ip_plan_file
for device_ip in ip_plan_Dict:
if device_ip != h: continue
device_ipplan_info = ip_plan_Dict[device_ip]
i = device_ipplan_info[0].attr("IP Address")
Now I do not know how to get only the IP without the mask and then add +2 to the last number to finally get: 1.1.1.3 y = "1.1.1.3" # for example
from excel_file I take a key named Key3 this will be the main key that I will use to get other info in another column in the same excel related to that key, for example, Site ID = key4.
Side note, if you have a general understanding of what the task is, you can google to find the appropriate methods. For example, I didn’t know what the command to reconnect a list after splitting it but I knew there is probably a command for it, so I googled “python join list to string” and found the .join() method.
Side note, if you have a general understanding of what the task is, you can google to find the appropriate methods. For example, I didn’t know what the command to reconnect a list after splitting it but I knew there is probably a command for it, so I googled “python join list to string” and found the .join() method.