I have the output of list1 in 1st column and I want list2 in 2nd column. How can I do this? Or does anyone has a better solution? list1 is for all folders (about 200+) in directory which are automatically generated with os.mkdir(directory). Now I want in 2nd column to check each folder for a file with .raw.txt and print Yes/No in the 2nd column. here you can see my output in csv
´
for list1 in fieldnames:
for path, dir_folder, files in os.walk(path):
for files in dir_folder:
w.writerow(files.split())
for list2 in fieldnames:
for files in os.listdir(path):
try:
if os.path.exists("*\\raw.txt"):
print("Yes")
else:
print("No")
except:
continue`