span8
span4
span8
span4
I need to compare file sizes and other attributes for a PRE upgrade and POST upgrade output files.O would like to get the list of files from both folders and compare the sizes, names and type.I am new to python and really need help writing a python script.
If you're not comfortable using Python, my recommendation would be to simply use the "Directory and File Pathnames" reader, it can give you the file sizes straight away:
That way you can avoid using Python.
Try something like:
import os def compare_file_sizes(feature): filesize1 = os.stat(feature.getAttribute('filename1')).st_size filesize2 = os.stat(feature.getAttribute('filename2')).st_size feature.setAttribute('filename1_size', filesize1) feature.setAttribute('filename2_size', filesize2)
Given an input feature with the attributes "filename1" and "filename2", it will add the two attributes "filename1_size" and "filename2_size" to the output feature.
You can e.g.combine this with the "Directory and File Pathnames" reader to list the contents of any directory.
Why use fme over python and arcpy?7 Answers
Dynamic reader parameters0 Answers
Start FME from command line: Wait until translation is finished5 Answers
Running a workspace from cmd.exe2 Answers
© 2019 Safe Software Inc |Legal