Hi,
in a nutshell, you probably want to iterate through all the lines your file. Then you would split the string (line) into 3 substrings (your variables) and store the 3 substrings in 3 variables.
in a nutshell, you probably want to iterate through all the lines your file. Then you would split the string (line) into 3 substrings (your variables) and store the 3 substrings in 3 variables.
with open(data_txt, 'r') as f: #open the file for line in f: #iterate through every line of a text file split_string = line.split() #split the line in a text file into substrings, in this case stored in a list "split_string" vlan= split_string[0] #access first element in "split_string" vlanname= split_string[1] #second element.. subnet = split_string[2] #third element... # here I guess you run your commands with vlan, vlanname and subnetDoes this help?