INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Find & Replace  (Read 1107 times)

bMinor

  • World Citizen
  • ***
  • Posts: 158
Find & Replace
« on: January 05, 2021, 10:13:26 am »

I'm still on MC25 and this might not apply to the latest version but I thought i'd post it here anyways in case it does apply.

Is there a way to make 'Find & Replace' within the library tools accept the characters ?, ", and /  when trying to just change the directory?
Find & Replace in MC25 fails to recognize any filename or path (eg folders) containing these characters. It seems like a Windows thing but should not happen on a Mac were these characters can be used anywhere.

examples:
a path like this one is not accepted because of the ? in the filename...:
Volumes/HD2/Music/Beatles - White Album (1968)/15 - Why Don't We Do It In The Road?

the / between the years prevents anything following from being read:
Volumes/HD2/Music/Beatles - Greatest Hits (1962/1968)/...

the " prevents the file being read:
Volumes/HD2/Music/Beatles - Please Please Me [7" Single) (1962)/01 - Please Please Me

The only thing that changed from the original files and locations is the path from HD1 to HD2. Everything else
stayed the same.

(I also noticed that filenames with a leading blank space don't work either)

Yes, library backups are a life saver.

Sorry for posting in the wrong place if the above does not apply anymore in newer versions.
Logged

HaWi

  • Citizen of the Universe
  • *****
  • Posts: 946
Re: Find & Replace
« Reply #1 on: January 05, 2021, 10:17:30 am »

I believe that in the expression you use to define the search string you have to use an "escape" character (here the escape character is /) before the special character. So to find ? you use /?, to find / it is //
Good luck!
Logged
rPi5/8GB, Debian 12 Bookworm on SSD | JRMark (33.0.37 64 bit): 2784
MacBookPro (2013), 2.6 GHz Quad-Core Intel Core i7, MacOS 11.7.17 | JRMark (33.0.41 64 bit): 3826
Mac Studio M2 Max, 64GB, 1TB SSD, macOS Sequoia 15.1.1 | JRMark (33.0.41 64 bit): 9056
Docker Container (shiomax) DS1819+ | JRMark (33.0.37 64 bit): 1431
JRemote 3.43
MO 4Media 1.5.7 | Marantz SR7007 (RSL 5.1) HDMI to MacBookPro

bMinor

  • World Citizen
  • ***
  • Posts: 158
Re: Find & Replace
« Reply #2 on: January 05, 2021, 10:46:38 am »

Hi HaWai,
thanks for replying.
Sorry for being unclear in my 1st post. It's the 'Find & Replace' within the library tool 'Rename, Move & Copy'.
I have 2 identical folders (the original on HD1 (which is dying) and a copy on HD2).
All I want to do is using 'Find & Replace' to change the path from 'Volumes/HD1/Music/...'  to 'Volumes/HD2/Music/...
It does not work with files and/or paths containing any of those characters (", ?, /), all others work.
how?
Logged

HaWi

  • Citizen of the Universe
  • *****
  • Posts: 946
Re: Find & Replace
« Reply #3 on: January 05, 2021, 01:22:17 pm »

Can you make a screenshot after pressing F6 to show how you have set it up? Is the Find & Replace checked or unchecked? If you just want to change the path I would let that unchecked.
Normally if you just replace the path /Volumes/HD1/... with /Volumes/HD2/...  that should just point to HD2 and you should see everything at HD2.
Paths, I believe in any OS (Windows, Mac, Linux cannot contain ?/ is interpreted as a folder level. I believe " should be OK.
File names can contain ? and " but also not / because that as well, would create another folder level.
If the R,M&C cannot find files with " or ? that may point to encoding differences. I have had to replace special characters in file names with "manually" generated ones, even though they "looked" exactly the same.
Logged
rPi5/8GB, Debian 12 Bookworm on SSD | JRMark (33.0.37 64 bit): 2784
MacBookPro (2013), 2.6 GHz Quad-Core Intel Core i7, MacOS 11.7.17 | JRMark (33.0.41 64 bit): 3826
Mac Studio M2 Max, 64GB, 1TB SSD, macOS Sequoia 15.1.1 | JRMark (33.0.41 64 bit): 9056
Docker Container (shiomax) DS1819+ | JRMark (33.0.37 64 bit): 1431
JRemote 3.43
MO 4Media 1.5.7 | Marantz SR7007 (RSL 5.1) HDMI to MacBookPro

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Find & Replace
« Reply #4 on: January 05, 2021, 01:26:17 pm »

Do you have the check box immediately to the left of the words "Find and Replace" checked? Because if you don't, you have that module disabled.
Logged

bMinor

  • World Citizen
  • ***
  • Posts: 158
Re: Find & Replace
« Reply #5 on: January 06, 2021, 03:00:35 pm »

thank you both for your input.
MC can read any character the 1st time and import the file no matter what it's called it seems. however, file or pathnames cannot contain any of these four characters  ", /, ?,*  if you plan to eventually move the directory using MC's 'find & replace' in the library tools. Also, the filename is not being read if it starts with a 'space'.
Simply just re-importing the moved files in question works but you'd be in the same boat if you need to change directory again after that. I bit the bullet and started altering the file names/paths manually...hey I'm at the letter E. In a couple of days I should be done. Thank god for retirement... :)
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Find & Replace
« Reply #6 on: January 06, 2021, 03:10:20 pm »

Linux doesn't allow '/' in filenames, as that is the directory separator char. It does allow '?' and '*' and a few others which are forbidden in Windows. So you might have some files with those chars, but that's not advisable for compatibility reasons. Perhaps MC doesn't handle them correctly due to common code with the Windows version.

If you have the files on a Linux filesystem such as EXT2/3 (or a NAS, for instance), but you're using MC for Windows to manage those files, you might run into problems.

You should avoid other chars in the filenames for compatibility. Here's a list:
https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions

Quote
The following reserved characters:
< (less than)
> (greater than)
: (colon)
" (double quote)
/ (forward slash)
\ (backslash)
| (vertical bar or pipe)
? (question mark)
* (asterisk)
Logged

HaWi

  • Citizen of the Universe
  • *****
  • Posts: 946
Re: Find & Replace
« Reply #7 on: January 07, 2021, 09:38:09 am »

Linux doesn't allow '/' in filenames, as that is the directory separator char. It does allow '?' and '*' and a few others which are forbidden in Windows. So you might have some files with those chars, but that's not advisable for compatibility reasons. Perhaps MC doesn't handle them correctly due to common code with the Windows version.

If you have the files on a Linux filesystem such as EXT2/3 (or a NAS, for instance), but you're using MC for Windows to manage those files, you might run into problems.

You should avoid other chars in the filenames for compatibility. Here's a list:
https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions
The reason files that contain special characters are not found after saving them is that MC replaces these characters with a permissible one. E.g. : is replaced with _. I am not entirely sure right off the top of my head but it maybe that all special characters are replaced by _.
Logged
rPi5/8GB, Debian 12 Bookworm on SSD | JRMark (33.0.37 64 bit): 2784
MacBookPro (2013), 2.6 GHz Quad-Core Intel Core i7, MacOS 11.7.17 | JRMark (33.0.41 64 bit): 3826
Mac Studio M2 Max, 64GB, 1TB SSD, macOS Sequoia 15.1.1 | JRMark (33.0.41 64 bit): 9056
Docker Container (shiomax) DS1819+ | JRMark (33.0.37 64 bit): 1431
JRemote 3.43
MO 4Media 1.5.7 | Marantz SR7007 (RSL 5.1) HDMI to MacBookPro

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2619
Re: Find & Replace
« Reply #8 on: January 07, 2021, 10:02:41 am »

MC shouldn't import them in the first place. No point in importing a file if it can't then work with it. Perhaps MC can warn the user and ask permission to rename the file itself.
Logged

bMinor

  • World Citizen
  • ***
  • Posts: 158
Re: Find & Replace
« Reply #9 on: January 12, 2021, 08:58:58 am »

And the best answer is:

MC shouldn't import them in the first place. No point in importing a file if it can't then work with it. Perhaps MC can warn the user and ask permission to rename the file itself.

Logged

HaWi

  • Citizen of the Universe
  • *****
  • Posts: 946
Re: Find & Replace
« Reply #10 on: January 12, 2021, 01:18:30 pm »

Indeed, it would be really nice if the warning included information about which characters are problematic and if they are going to be automatically replaced and by what alternative character.
Logged
rPi5/8GB, Debian 12 Bookworm on SSD | JRMark (33.0.37 64 bit): 2784
MacBookPro (2013), 2.6 GHz Quad-Core Intel Core i7, MacOS 11.7.17 | JRMark (33.0.41 64 bit): 3826
Mac Studio M2 Max, 64GB, 1TB SSD, macOS Sequoia 15.1.1 | JRMark (33.0.41 64 bit): 9056
Docker Container (shiomax) DS1819+ | JRMark (33.0.37 64 bit): 1431
JRemote 3.43
MO 4Media 1.5.7 | Marantz SR7007 (RSL 5.1) HDMI to MacBookPro
Pages: [1]   Go Up