Page 1 of 1

Output filename parameters

Posted: Sun Aug 30, 2015 4:13 pm
by Mixer
'nconvert -help' wrote: -no# : # not used for numeric operator

-o filename : Output filename
Use # to specify position of numeric enumerator
Use % to specify source filename
Use $ to specify full source pathname
Use $$ to specify source folder name
Use $EXIF:DateModified[date format] to specify EXIF date modified
Use $EXIF:DateTaken[date format] to specify EXIF date taken
Hi. While user in this thread was satisfied, working with files and paths containing nonalphabetical characters in their names might be troublesome. I'd like to propose change in command design for your consideration. Keep -o as key for defining base output filename string. Use another key for aItering base name if needed, -om for example.
Set for this key syntax something like
'-om imaginary syntax' wrote:-om position:modifier[;position:modifier[;position:modifier...]]

positon - position in base filename where modifier must be inserted (if few modifiers share the same target position, precedence goes in order they stand in command string)
modifier - some operator (# for numeric enumerator, % for original filename, $$ for source folder name, "text" for inserting text etc.)

Code: Select all

nconvert.exe -o "My % cRaZy $ NamEd FiLe #" -om 1:$$;26:#;26:" which once was ";26:% -resize longest 100 "C:\Pictures Directory\original.jpg"
Then if nconvert autoappends \ to the end of source folder name, output would have to be "C:\Pictures Directory\My % cRaZy $ NamEd FiLe #1 which once was original.jpg"

Disadvantage: you have to count position for inserting new parts, command string gets longer and you lose visual simplicity of name changing.
Advantage: you don't have interpretation conflicts in base output filename, any allowed characters may be used and -om may not be used at all if not needed.
I hope you get the idea, implementing it could be done some other way.

I don't propose using reserved characters from this list instead of currently used #%$ because nconvert is crossplatform (or do versions for Win, Mac and Linux differ?), and some of reserved in Windows characters are allowed in filenames in Unix.

Re: Output filename parameters

Posted: Tue Sep 01, 2015 4:42 am
by xnview
you would like to use %#$ as output filename?

Re: Output filename parameters

Posted: Tue Sep 01, 2015 9:28 am
by Mixer
I would like that utility I use did its job quietly without imposing more restrictions on character set for naming files than it is already done by operating system.
If this user here will use -no# option he'll be fine with writing to folders with # in name, but he will lose chance to use numerators in his converting.
By your logic you should add -no$ and -no% options too.
And I will use any of $%# characters whenever I want because I'm not using nconvert. I just sometimes help others with their tasks on altruistic basis.

Re: Output filename parameters

Posted: Tue Sep 01, 2015 11:28 am
by xnview
i've already added for next version '$#' to escape '#', perhaps i can add '$$' & '$%'?

Re: Output filename parameters

Posted: Tue Sep 01, 2015 12:31 pm
by Mixer
Are you going to add escape character to escape sequence "$#" if it is present in name of file too? And then add another escape character to escape this new escape character if you again choose some character allowed for using in filenames? Until all filename is filled by escape characters up to MAX_PATH? Persecution mania much?

xnview wrote:perhaps i can add '$$'
, '$$' is already in use by
nconvert -help wrote: -o filename : Output filename
Use $$ to specify source folder name