Question: import csv import re # Read Baselight _ export.txt file file _ baselight = open ( ' / Users / sayrareyes / Python - Projects

import csv
import re
# Read Baselight_export.txt file
file_baselight = open('/Users/sayrareyes/Python-Projects/COMP-467-Assignment/Baselight_export.txt','r')
# print(file_baselight.read())
# Read Xytech.txt file
with open('Xytech.txt','r') as f:
# xytech_file =[]
xytech_data = f.read().splitlines()
# Baselight_export.txt file
baselight_data =[]
for currentReadline in file_baselight:
if not currentReadline.strip():
continue
print("Current read:
"+ currentReadline)
parse_line = currentReadline.split()
if not parse_line:
continue
print("Baselight file: ", parse_line)
current_folder = parse_line.pop(0)
parse_folder = current_folder.split("/")
parse_folder.pop(1)
new_folder ="/".join(parse_folder)
print("Parse Folder: ", parse_folder)
print("New Folder: ", new_folder)
print('----------------------------------------------------------------')
for xytech_file in xytech_data:
isVerbose = True
if new_folder in xytech_file:
# print("Found: "+ new_folder +""+ xytech_file)
current_folder = xytech_file.strip()
# Process frames and ranges
def process_frames(location):
frames =[]
for entry in xytech_data:
if entry.startswith(location):
frames.extend(re.findall(r'\b\d+\b', entry))
frames =[int(frame) for frame in frames]
frames.sort()
return frames
print(xytech_data)
print('----------------------------------------------------------------')
# Export CSV File
with open("baselight_and_xytech.csv",'w', newline='') as csvfile:
writer = csv.writer(csvfile)
writer.writerow(['Producer', 'Operator', 'Job', 'Notes'])
writer.writerow(['Olivia Rodrigo', 'Johnny Bananas', ' Dirtfixing', 'Please clean files noted per Colorist Brock '
'Purdy'])
writer.writerow([]) # Empty row
writer.writerow(['Show Location', 'Frame to fix'])
writer.writerow([''])
writer.writerow([]) # Empty rowImport file created from baselight (Baselight_export.txt)
Import xytech work order (Xytech.txt)
Script will parse data
Computation done to match shareholder request, to replace file system from local baselight to facility storage
(remember color correcter's prefer local storage for bandwidth issues)
Remember we are dealing with 3rd party data, so some errors in the data might occur and you have to deal
Xytech Workorder 1109
Producer: Olivia Rodrigo
Operator: Johnny Bananas
Job: Dirtfixing
Location:
/hpsans13/production/Dune2/reel1/partA/1920x1080
/hpsans12/production/Dune2/reel1/VFX/Hydraulx
/hpsans13/production/Dune2/reel1/VFX/Framestore
/hpsans14/production/Dune2/reel1/VFX/AnimalLogic
/hpsans13/production/Dune2/reel1/partB/1920x1080
/hpsans15/production/Dune2/pickups/shot_1ab/1920x1080
/hpsans11/production/Dune2/pickups/shot_2b/1920x1080
/hpsans17/production/Dune2/reel1/partC/1920x1080
Notes:
Please clean files noted per Colorist Brock Purdy
/baselightfilesystem1/Dune2/reel1/partA/1920x1080234313233676869
70122123155102311111112116012011202120312041205121112121213
12141215
/baselightfilesystem1/Dune2/reel1/VFX/Hydraulx 1251125212531260
127012711272
/baselightfilesystem1/Dune2/reel1/partA/1920x108013021303131015005000
50015002
/baselightfilesystem1/Dune2/pickups/shot_1ab/1920x10805010501150125013
5014
/baselightfilesystem1/Dune2/reel1/partA/1920x108051115122513351445155
5166
/baselightfilesystem1/Dune2/reel1/VFX/Framestore 618861896190
6191
/baselightfilesystem1/Dune2/reel1/VFX/Hydraulx 619761986199
/baselightfilesystem1/Dune2/reel1/partA/1920x108062006201620962126219
6233623462676269627162786282628862896290629262936294
/baselightfilesystem1/Dune2/reel1/partB/1920x108064096410641164136450
6666666766686670667166806681668266836684
/baselightfilesystem1/Dune2/reel1/VFX/AnimalLogic 68326833683469116912
69136914
/baselightfilesystem1/Dune2/reel1/partB/1920x10808845
/baselightfilesystem1/Dune2/reel1/VFX/Hydraulx 8846
/baselightfilesystem1/Dune2/reel1/VFX/Framestore 8847
/baselightfilesystem1/Dune2/pickups/shot_2b/1920x1080100011000210008
11113
/baselightfilesystem1/Dune2/reel1/partB/1920x108012011120211203112041
120511211112121

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!