You are not logged in.
Pages: 1
I would like the case filter to have some options like the delete filter
- from position 3 until end (to preserve the case of the first two characters)
- all charaters after the first space (delimiter)
etc
Offline
It is better for the standard rules to be generalized - for better understanding and ease of use. All that you are asking for - can be done using the PascalScript rule. Here are the sample scripts how it can be achieved:
1) LowerCase from position 3 to the end:
var
Begining, Ending: string;
begin
Begining := Copy(FileName, 1, 2);
Ending := Copy(FileName, 3, Length(FileName));
FileName := Begining + LowerCase(Ending);
end.
2) LowerCase after the first space:
var
Begining, Portion: string;
Position: Integer;
begin
Position := Pos(' ', FileName);
if (Position > 0) then
begin
Begining := Copy(FileName, 1, Position-1);
Portion := Copy(FileName, Position, Length(FileName));
FileName := Begining + LowerCase(Portion);
end;
end.
3) LowerCase from position 3 to first bracket and extension:
var
BaseName, Extension: string;
Begining, Portion, Ending: string;
Pos1, Pos2: Integer;
begin
BaseName := ExtractBaseName(FileName);
Extension := ExtractFileExt(FileName);
Pos1 := 3;
Pos2 := Pos('(', BaseName);
if (Pos2 > Pos1) then
begin
Begining := Copy(BaseName, 1, Pos1-1);
Portion := Copy(BaseName, Pos1, Pos2-Pos1);
Ending := Copy(BaseName, Pos2, Length(BaseName));
BaseName := Begining + LowerCase(Portion) + Ending;
end;
FileName := BaseName + LowerCase(Extension);
end.
Offline
thanks that helped me sort out some functions for other scripts.
Offline
Pages: 1