Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Project 1 : import / export script Import file created from baselight ( Baselight _ export.txt ) Import xytech work order ( Xytech . txt
Project : importexport script
Import file created from baselight Baselightexport.txt
Import xytech work order Xytechtxt
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 rd party data, so some errors in the data might occur and you have to deal with it ie
Export CSV file indicates columns:
Line : Producer Operator job notes
Line : show location frames to fix
Frames and frame ranges processed in consecutivenumerical order shown from baselightexport.txt as either:
ranges ie filesystemDunePartAx
individually ie filesystemDunePartAx
Frames shown need to reflect their proper location and not mix with ranges from another location
import csv
import re
printCurrent files:
print
# parsing two files, computationally two things frame ranges and folder fix and exporting cvs files
# method import and read baselight file
with openBaselightexport.txtr as file:
baselightdata
Baselightdata file.read
printBaselightdata
# method to import and read xytech file
with openXytechtxtr as file:
xytechdata
Xytechdata file.read
printXytechdata
print
# Function to parse Baselight.txt
def parsebaselightdata:
data
with openBaselightexport.txtr as file:
lines file.readline
currentlocation None
for line in lines:
line line.strip
if line.startswithbaselightfilesystem:
currentlocation line
datacurrentlocation
else:
frames refindallrd line
datacurrentlocation
return data
# Function to parse Xytech.txt
def parsexytechdatadata:
parseddata
for line in data:
parsedline line.split
# parsedline line.split
showlocation parsedline
framesfix parsedline
parseddata.appendShow Location': showlocation, 'Frames to Fix': framesfix
return parseddata
# Function to compute frame ranges
def computeframesdata:
for line in data:
framesfix line.getFrames to fix'
if framesfix:
ranges refindallrddjoinframesfix
if ranges:
lineFrames Ranges' ranges
# Combine data and compute frame ranges
combineddata baselightdata xytechdata
printCombined data: combineddata
computeframescombineddata
printComputed data: combineddata
# Parse Baselight data
parsebaselightdata parsebaselightdata
printParsed Baselight data: parsebaselightdata
# Parse Xytech data
parsexytechdata parsexytechdataxytechdata
printParsed Xytech data: parsexytechdata
# Export to csv
with openbaselightandxytech.csvw newline as csvfile:
writer csvwritercsvfile
writer.writerowProducer 'Operator', 'Job', 'Notes'
writer.writerow
writer.writerow
writer.writerowShow Location', 'Frame to fix'
for row in combineddata:
writer.writerow
row.getProducer
row.getOperator
row.getJob
row.getNotes
row.getShow Location'
row.getFrames Fix'
writer.writerow
writer.writerow
writer.writerow
writer.writerow
row.getFrames Ranges',
joinmapstr row.getFrames fix',
joinmapstr row.getFrames Ranges',
Project: example with random data
Xytech:
ddnsanavengersreelx
Baselightexport:
imagesavengersreelx
ddnsanavengersreelx
ddnsanavengersreelx
ddnsanavengersreelx
WHAT IS WRONG WITH MY CODE I CANT GET IT TO WORK
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started