Building buildings 0.1
1 min readNov 16, 2021
It’s been a while since I looked at SSIS, it’s been basically never since I used Python, so I’m doing both in a simple project to learn and refresh.
It’s a work in progress so here we go!
The project is sitting here on github if you want to dig around but here’s the basic idea:
- Run a Python script to grab a list of the directories in whatever root directory we have been given
import os
import csv
baseDirectory = 'C:/'
# We need an array for the directories
directories = []
# Grab a copy of the full paths of the files and directories to process
filesOrDirectories = os.listdir(baseDirectory)
filesOrDirectoriesPaths = map(lambda name: os.path.join(baseDirectory, name), filesOrDirectories)
# For each object, only store it if it's a directory
for file in filesOrDirectoriesPaths:
if os.path.isdir(file): directories.append(file)
# Output the list of directories to a csv for processing
with open('C:/data/data.list.directories.csv', 'w', newline= '') as f:
write = csv.writer(f)
write.writerow(['Directory'])
for item in directories:
write.writerow([item])
- Once we have the csv created, load it up into SSIS and we’ll have a play around with it. This bit will be done tomorrow though!