Search and replace, and search view

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Daiman
Posts: 3
Joined: 04 Jun 2018 09:40

Search and replace, and search view

Post 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

highend
Posts: 15004
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Search and replace, and search view

Post 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
One of my scripts helped you out? Please donate via Paypal

Daiman
Posts: 3
Joined: 04 Jun 2018 09:40

Re: Search and replace, and search view

Post 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.

highend
Posts: 15004
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Search and replace, and search view

Post 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
One of my scripts helped you out? Please donate via Paypal

Daiman
Posts: 3
Joined: 04 Jun 2018 09:40

Re: Search and replace, and search view

Post 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.

highend
Posts: 15004
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Search and replace, and search view

Post 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
One of my scripts helped you out? Please donate via Paypal

Post Reply