Icon

Move corrupted Excel Files from folder with row counting

There has been no title set for this workflow's metadata.

Demo workflow to find all corrupted xlsx files in a folder and move them to a "bad" folder.

Find all .xlsx filesin c:\temp folderchange this to yourrequired folderget each file path as variableattempt to openhandle errorstop branch no errorbottom branch - failurewe assume that if there is an errorin opening file, it is becausefile is corrupt!move file to "bad" folderdo nothing simply here to allow usto connect flow to the lower branchdo nothing simply here to allow usto connect flow to the lower branchopen a blank "template" copyof the spreadsheetcontaining the headings but not data.This is used in place of a corrupted filereplace this with Variable Loop Endif simply removing bad files, and don't need to consolidatethe rows from each execute to view workflow data area foldersget row andcolumn countAppend file pathget pathas stringadd 1 (to include header rowtoo)Remove this if just counting data rowsremove "number of columns"Append failure indicatorList Files/Folders Table Row ToVariable Loop Start Excel Reader Try (VariablePorts) Catch Errors(Data Ports) Java IF (Table) End IF Transfer Files NoOp (Table) NoOp (Table) Excel Reader Loop End Open File or Folder Extract TableDimension ConstantValue Column Path to String(Variable) Table Transposer Math Formula Column Filter ConstantValue Column Find all .xlsx filesin c:\temp folderchange this to yourrequired folderget each file path as variableattempt to openhandle errorstop branch no errorbottom branch - failurewe assume that if there is an errorin opening file, it is becausefile is corrupt!move file to "bad" folderdo nothing simply here to allow usto connect flow to the lower branchdo nothing simply here to allow usto connect flow to the lower branchopen a blank "template" copyof the spreadsheetcontaining the headings but not data.This is used in place of a corrupted filereplace this with Variable Loop Endif simply removing bad files, and don't need to consolidatethe rows from each execute to view workflow data area foldersget row andcolumn countAppend file pathget pathas stringadd 1 (to include header rowtoo)Remove this if just counting data rowsremove "number of columns"Append failure indicatorList Files/Folders Table Row ToVariable Loop Start Excel Reader Try (VariablePorts) Catch Errors(Data Ports) Java IF (Table) End IF Transfer Files NoOp (Table) NoOp (Table) Excel Reader Loop End Open File or Folder Extract TableDimension ConstantValue Column Path to String(Variable) Table Transposer Math Formula Column Filter ConstantValue Column

Nodes

Extensions

Links