Looking to bypass or accept duplicate filesI'm currently writing code to pull the files with the same ending into one concatenated file. I'm noticing that when it gets to a duplicate file, the code breaks. Is there a way I could code this to accept the duplicate file as well? I know it may be as simple as renaming the file, but I wanted to reach out for answers first.
If(
N Items(lotFiles) == 1, CalibrationTable = lotFiles[1],
N Items(lotFiles) > 1,
CalibrationTable = lotFiles[1] << concatenate(lotFiles1, create source column);
For(i = 1, i <= N Items(lotFiles), i++,
Close(lotFiles[i], nosave)
);,
N Items(lotFiles) == 0,
Print("no lot data, please try again");
Return(0);
);ScriptingRe: Looking to bypass or accept duplicate filesYou have a list of files called
lotfiles
and you reference it using a subscript when referring to a single element, and without a subscript when referencing the entire list. However, you also have a variable referenced as
lotfiles1
is this an error?
Re: Looking to bypass or accept duplicate filesIt looks to me like your second if statement needs work, maybe something like this:
If(
N Items(lotFiles) == 1, CalibrationTable = lotFiles[1],
N Items(lotFiles) > 1,
CalibrationTable = lotFiles[1];
For(i = 2, i <= N Items(lotFiles), i++,
CalibrationTable << concatenate(lotFiles[i], create source column);
Close(lotFiles[i], nosave)
);,
N Items(lotFiles) == 0,
Print("no lot data, please try again");
Return(0);
);