Creating a Smart Collection of images with + in their filename?

Status
Not open for further replies.

chongo

New Member
Joined
Aug 18, 2009
Messages
11
Location
Sunnyvale, CA
For historical reasons, I have a number of images with filenames that have + inside them. I wish to create a Smart Collection with those images. Unfortunately, the match rule:

Filename contains +

does not have the desired effect. How might this be done?

chongo (Landon Curt Noll) /\oo/\
 
It is interesting to note that the match rule:

filename contains foo+

will match filenames that end with foo. For example:

filename contains 1f.cr2+

seems to match filenames of the form:

*1f.cr2

Whereas:

filename contains +14

seems match filenames of the form:

14*

The + does not seem to be a normal regular expression symbol. The "all characters except" aspect seems to operate on the opposite side of the contains string on which it is placed.

Any ideas on what + is really doing in the filename match?

My usual attempts to escape the + somehow and have the contains match a literal plus failed. Any ideas on how to match a literal +?
 
::) + :eek:

Even if your operating system let you use such characters in filenames as +, Windows/DOS also use it as a concatenation operator on files at system level! By using other symbols as the letters and numbers, you are exposing yourself to problems when changing from one computer to another or sending files on the Internet... OK. This is not a solution so: First try to change all those in Lightroom by replacing "+" by "_". The advantage will be that ALL operating systems will be compatible and even filenames sent to the internet through galeries and even with shopping cart operations to match the names back to your system.

As you have discovered, in Lightroom, the + sysbol is meant to mean +StartWith or EndWith+ and the ! symbol in front of a word is used to mean does not contain.

Do you have many to rename?... :icon_exclaim:
 
[quote author=Denis Pagé link=topic=7581.msg51919#msg51919 date=125'642386]
::) + :eek:

Even if your operating system let you use such characters in filenames as +, Windows/DOS also use it as a concatenation operator on files at system level! By using other symbols as the letters and numbers, you are exposing yourself to problems when changing from one computer to another or sending files on the Internet... OK. This is not a solution so: First try to change all those in Lightroom by replacing "+" by "_". The advantage will be that ALL operating systems will be compatible and even filenames sent to the internet through galeries and even with shopping cart operations to match the names back to your system.
[/quote]

Denis,

Thank you for taking the time to reply. I don't want to get sidetracked down an OS rat hole, so in this message I will reply to your first paragraph now. I'll reply to the rest of your message in a later posting.

If you look at this comparison of file name limitations (click the link for details), you will find that the + character is not a reserved character in most filesystems: Win95 VFAT being one of the most notable counter-examples.

Since you mentioned DOS: A strict DOS file is limited the 8.3 filename convention (click the link for details). It turns out that + is a legal character in MS-DOS FAT. However, I won't cripple my workflow to strict DOS 8.3 filenames. Even when I get a file on a DOS flash drive, I convert its filename to something that best fits my workflow when I import it. The same goes for not crippling myself to the Win95 VFAT filesystem limitations. People who use systems with filename limitations are free, when they download my images, to rename them to whatever suits their workflow and environment.

The + is a valid character in various portable filename IEEE and ISO standards. I stick to filenames allowed in the IEEE 1''3 fully portable filenames set as well as the IEEE P1282 RockRidge/ISO 966' CDROM standard. I do this because I have switched the filesystem on which I store my images several times. By sticking to portable standard filenames, I help ensure that my filenames will be portable across the multiple operating systems that I use now, and that I might use in the future.

So what about issues that you mentioned in regards to certain Microsoft products? That is a fair question.

A friend who has a Microsoft Vista system and another that has the newest Windows beta system verified that + filenames are just file on their systems. She did mention that there was a minor annoyance with some shell tool: a limitation she said that had an easy work-around. She also mentioned that her Microsoft apps opened and processed my images+with+in+them just fine.

Speaking strictly for myself, my answer is thus:

I don't use any historic Microsoft products now. I avoid using the currently supported Microsoft product line as well. Sorry if I offend anyone, I don't mean to troll. I'm just being honest. Sometime in the future Microsoft might produce a product line that interoperates better with the rest of the computing world. However until that happens, I will continue to use some of the many other product lines that are available today.

FYI: I do use more than just Mac OS. The profile used by this forum does not allow me to list all of my various systems. ;)


chongo (Landon Curt Noll) /\oo/\
 
[quote author=Denis Pagé link=topic=7581.msg51919#msg51919 date=125'642386]
::) + :eek:

First try to change all those in Lightroom by replacing "+" by "_".

As you have discovered, in Lightroom, the + sysbol is meant to mean +StartWith or EndWith+ and the ! symbol in front of a word is used to mean does not contain.

Do you have many to rename?... :icon_exclaim:
[/quote]

BTW: Regarding the syntax: It seems counter intuitive that +foo means starting with foo. It would have been better to use foo+ where the + means 1 or more characters following foo, for example.

Regarding renaming +'s to something else such as _'s:

I cannot replace + with _ because I already use the underscore in another context. And there is always a possibility that this replacement could produce a filename collision. Yes, I would have many filenames with +'s to rename. Renaming is not a good option. And why should I? Lightroom, with the sole exception of a programming limitation of the Smart collection match code, works with images that have +'s in them just fine.

In general, Lightroom should have some sort of match escape mechanism to allow someone to indicate that a magic character should be considered as a literal. Lightroom should add a 3rd magic character, say another character that is not part of the portable filename set, that means the next character is literal, not magic. So: "[MAGIC_CHAR]+" would mean a literal +.

How about this idea:

Add code to lightroom to treat ++ as a single literal +. Since + today is a magic character in the match rules, extending the match code to treat a ++ as if it were a non-magic plus might be OK. The same could go for !! meaning a single literal ! if you wanted.

chongo (Landon Curt Noll) /\oo/\
 
It's very much as Denis says. The minutiae of whether one OS or another reserves the + character are irrelevant, because "by using other symbols as the letters and numbers, you are exposing yourself to problems...." You've hit one now with a program that doesn't handle escapes for special characters and treats + as reserved, while your friend hit another. The best way forward would be to correct the file names.
 
[quote author=johnbeardy link=topic=7581.msg51975#msg51975 date=125'749327]
It's very much as Denis says. The minutiae of whether one OS or another reserves the + character are irrelevant, because "by using other symbols as the letters and numbers, you are exposing yourself to problems...." You've hit one now with a program that does handle escapes for special characters and treats + as reserved, while your friend hit another. The best way forward would be to correct the file names.
[/quote]

Had Lightroom chosen to use one of the many common regex conventions, or filename matching, or filename globing in their match rules, all would be OK. The issue is having a magic character without a means to escape it.

And as I pointed out, use of filenames with +'s in them seems to work just fine throughout the rest of the application.

I think the idea of treating ++ as a single literal + might be a reasonable extension to the match code.

chongo (Landon Curt Noll) /\oo/\
 
And I huff and puff too, but that ain't going to change the way it is. You'd be better off correcting those file names.
 
[quote author=johnbeardy link=topic=7581.msg51978#msg51978 date=125'75'681]
And I huff and puff too, but that ain't the way it is. You'd be better off correcting those file names.
[/quote]

There must some software out there would would batch replace all the "+" to something else ??
 
[quote author=chongo link=topic=7581.msg51973#msg51973 date=125'747833]
Since you mentioned DOS: A strict DOS file is limited the 8.3 filename convention (click the link for details). It turns out that + is a legal character in MS-DOS FAT.[/quote]
You just made me wonder if my memory was good... ;)

I took a WinXP machine and was able to create long or short filenames containing "+" with Notepad (Textedit equiv.). Altough, in the console (cmd), I wasn't! (Example: copy con a+b.txt). The dir command wansn't listing the files previously created containing "+" and so, no command were able to work on such files as in: copy a+b.txt c.txt

But as John properly say, the point is that "you expose yourself to potential problems". Above is a case where XP permit "+" in filenames but can't handle them in console.
 
[quote author=Denis Pagé link=topic=7581.msg5199'#msg5199' date=125'783639]I took a WinXP machine and was able to create long or short filenames containing "+" with Notepad (Textedit equiv.). Altough, in the console (cmd), I wasn't! (Example: copy con a+b.txt). The dir command wansn't listing the files previously created containing "+" and so, no command were able to work on such files as in: copy a+b.txt c.txt

But as John properly say, the point is that "you expose yourself to potential problems". Above is a case where XP permit "+" in filenames but can't handle them in console.
[/quote]I ran through a similar exercise in Vista and had no problems. DIR worked fine and I could RENAME xyz124.txt to xyz+123.txt I could even rename xyz+123.txt to xyz.123.txt but could not come up with a wildcard RENAME to handle *+*.txt to anything with out the +. With a little work I could develop an AutoIT script to parse file names containing '+' and RENAME them to what ever new name I choose.

Even if the OP manages to rename the files, LR has them cataloged with the old file name and will not (easily) find them once renamed outside of LR.
 
Can't LR do that renaming?
 
[quote author=johnbeardy link=topic=7581.msg51995#msg51995 date=125'78575']
Can't LR do that renaming?
[/quote]For ones and twos, yes. I think the OP has 'oodles'. A batch process is more efficient for the rename, but not available to recatalog.
 
[quote author=johnbeardy link=topic=7581.msg51995#msg51995 date=125'78575']
Can't LR do that renaming?
[/quote]

Why should I rename? Apart from a limitation in filename match rules, having +'s in filenames are NOT a problem in Lightroom. And with a small addition to the match logic (allowing ++ to mean a literal +), even that match can be fixed.

chongo (Landon Curt Noll) /\oo/\
 
[quote author=chongo link=topic=7581.msg52''5#msg52''5 date=125'794616]
[quote author=johnbeardy link=topic=7581.msg51995#msg51995 date=125'78575']
Can't LR do that renaming?
[/quote]

Why should I rename? Apart from a limitation in filename match rules, having +'s in filenames are NOT a problem in Lightroom. And with a small addition to the match logic (allowing ++ to mean a literal +), even that match can be fixed.[/quote]Renaming is probably not a good plan if you have a lot of file to rename in LR. While I agree with you that the filter wildcard goes contrary to all other wild card conventions like regex and *.*. It depends how important using the text search on file names is to you. The search criteria conventions are not likely to get fixed before a new version and probably not then.


Here in Texas, we have a saying, "You need to dance with them that brung ya." This Lightroom is all you've got and it might be all you will get in this regard to filter query wild cards. So you use it warts and all and live within those constraints or you move on to something else. If I had only a few files named with a '+' in the file name, using LR, I would remove the '+' from all the image files and not have a problem with the filter criteria. If I had too many such files that renaming became impractical, I would not use a filter criteria where '+' was important to the search filter and hope that a future version of LR might have a more conventional search criteria.
 
Status
Not open for further replies.
Back
Top