Page 1 of 1

Search and replace, and search view

Posted: 04 Jun 2018 10:26
by Daiman
Hi all,

I do have a lot of folders and files which i need to rename, i have figured some but some others are so difficult, i appreciate it if anyone can help.

Case 1 - Where first 2 digits could be any number.
01 filename =>01. filename "this case where first 2 digits could be any number"
02 filename=> 02. filename

Case 2 - Search folder for files, but need to ignore first 4 digits and show result without them so i can sort them.
1985 filename => filename
1999 filename => filename

Re: Search and replace, and search view

Posted: 04 Jun 2018 10:40
by highend
Rename Special - RegExp Rename...
Use this pattern:

Code: Select all

^(\d{2}) > $1.
For the second thing you need a custom column with a script...
Enter:
snippet;
in the address bar and execute it with {ENTER}
Insert this snippet in that window:

Code: Select all

Snip: CustomColumn 1
  XYplorer 19.00.0007, 04.06.2018 10:38:27
Action
  ConfigureColumn
Caption
  Sort
Type
  3
Definition
  return trim(regexreplace(<cc_name>, "^\d{4}"));
Format
  0
Trigger
  0
Item Type
  0
Item Filter
  
Confirm it with the OK button and add that custom column to the current view

Re: Search and replace, and search view

Posted: 04 Jun 2018 11:52
by Daiman
Thanks Highend, i could execute the first code and it works, i can change # 2 according to how many digits i have.


The 2nd code i can't execute it as it is for PRO version and snippet is not allowed.

Really appreciated.

Re: Search and replace, and search view

Posted: 04 Jun 2018 11:57
by highend
The 2nd code i can't execute it as it is for PRO version and snippet is not allowed
Can't do anything against that. It's only possible by using a custom column

Re: Search and replace, and search view

Posted: 04 Jun 2018 12:00
by Daiman
It is ok, not abig issue as long it is not avalibe in free version.

Where i can find and learn all RegExp Rename commands.

Re: Search and replace, and search view

Posted: 04 Jun 2018 12:07
by highend
Where i can find and learn all RegExp Rename commands
You would need to learn regex to be able to do "everything" with it...

XY uses the regex engine from Visual Basic 6