I use the python code below which runs inside an Alteryx workflow. I would like to add a column so that it could list all files that are inside those folders. Any idea of how I can add this information to the code below?
from ayx import Alteryx
import pandas as pd
import numpy as np
import os
import glob
# FILE SERVER
fileDirectoryPath = Alteryx.read(r'#1')
filePathInput = fileDirectoryPath.iloc[0,0]
absPathList = glob.glob(filePathInput + '\\*\\*\\*\\*')
absPathListFiltered = [x for x in absPathList]
fullPathList = [f for f in absPathListFiltered if '.txt' not in f and '.bat' not in f]
folderList = [f.split('\\')[-1] for f in absPathListFiltered if '.txt' not in f and '.bat' not in f
and '.ini' not in f and '.gdoc' not in f]
parentList = [f.split('\\')[-2] for f in absPathListFiltered if '.txt' not in f and '.bat' not in f
and '.ini' not in f and '.gdoc' not in f]
np.array(fullPathList)
np.array(folderList)
np.array(parentList)
df_result = pd.DataFrame({'Files':folderList,'Parent':parentList,'FullPath':fullPathList})
Alteryx.write(df_result,1)