You are not logged in.
Pages: 1
Hello den4b Users!
I have a problem and i was really happy if somebody can help me. I have files with different dates in filename.
on one day:
0131_HSPBXN_P_001
0201_HSPBXN_P_001
0202_HSPBXN_P_001
The first 4 letters is a date. Is there a chance to rename to one day back?
So that the filenames change to:
0131_HSPBXN_P_001 -----> 0130_HSPBXN_P_001
0201_HSPBXN_P_001 -----> 0131_HSPBXN_P_001
0202_HSPBXN_P_001 -----> 0201_HSPBXN_P_001
Thank you for your help!!
Stefan
Offline
You can do this with a Pascal Script rule:
const
YEAR = 2018;
DAY_OFFSET = -1;
var
Month, Day: Integer;
FullDate: TDateTime;
begin
if TryStrToInt(Copy(FileName, 1, 2), Month) and
TryStrToInt(Copy(FileName, 3, 2), Day) then
begin
FullDate := EncodeDate(YEAR, Month, Day);
FullDate := IncDay(FullDate, DAY_OFFSET);
FileName := FormatDateTime('MMDD', FullDate) +
Copy(FileName, 5, Length(FileName));
end;
end.
Note the constants at the top of the scripts (YEAR and DAY_OFFSET).
Hopefully, soon, it will be possible to do the same with the Reformat Date rule.
Offline
It is now possible to adjust date/time components via the Reformat Date rule, as of ReNamer 7.0.0.3 Beta.
Offline
Pages: 1