nconvert unable to use filename substitution

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: XnTriq, helmut, xnview

simes

nconvert unable to use filename substitution

Post by simes »

Hi,

I want to convert all the tif files in one folder into a different folder using wildcards. I cannot get the %% filename substitution suggested in the help info to work.. I have tried it with single quotes, double quotes, double %% signs etc. I have tried from the command line, and in batch files. No joy.

I am doing this on a Windows 2003 SBS server.

e.g. nconvert -out tiff -multi -binary nodither -c 7 -o newfolder\%%.tif *.tif

any clues?

thanks
User avatar
xnview
Author of XnView
Posts: 44885
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: nconvert unable to use filename substitution

Post by xnview »

simes wrote:Hi,

I want to convert all the tif files in one folder into a different folder using wildcards. I cannot get the %% filename substitution suggested in the help info to work.. I have tried it with single quotes, double quotes, double %% signs etc. I have tried from the command line, and in batch files. No joy.

I am doing this on a Windows 2003 SBS server.

e.g. nconvert -out tiff -multi -binary nodither -c 7 -o newfolder\%%.tif *.tif

any clues?
Use:
nconvert -out tiff -binary nodither -c 7 -o newfolder\%%.tif *.tif
Pierre.
simes

Thanks, but..

Post by simes »

Piere.

Your suggestion is the same syntax as I have been using without success (apart from the fact that you removed the "-multi" - I assume this has no bearing on the filename substitution).

Are you saying that -o newfolder\%%.tif should work OK?

thanks
User avatar
xnview
Author of XnView
Posts: 44885
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Thanks, but..

Post by xnview »

simes wrote:Piere.

Your suggestion is the same syntax as I have been using without success (apart from the fact that you removed the "-multi" - I assume this has no bearing on the filename substitution).

Are you saying that -o newfolder\%%.tif should work OK?
Yes, should work. Use %% only in a .bat file.
Pierre.
Georgef

Post by Georgef »

I am also experiencing this problem but I noticed that it only occurs when using "-multi " or "-xall"

for example using:
nconvert -out tiff -binary nodither -c 7 -o newfolder\%.tif test.tif
outputs a file named: test.tif

but using:
nconvert -out tiff -multi -binary nodither -c 7 -o newfolder\%.tif *\test.tif
outputs a file named: %.tif

Any ideas?
(Note I am using version v4.92)

Thanks
User avatar
xnview
Author of XnView
Posts: 44885
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Post by xnview »

Georgef wrote:I am also experiencing this problem but I noticed that it only occurs when using "-multi " or "-xall"

for example using:
nconvert -out tiff -binary nodither -c 7 -o newfolder\%.tif test.tif
outputs a file named: test.tif

but using:
nconvert -out tiff -multi -binary nodither -c 7 -o newfolder\%.tif *\test.tif
outputs a file named: %.tif

Any ideas?
In a bat?
Pierre.
Georgef

Post by Georgef »

No, not from a bat. I am running from the command prompt.
Following are three examples of the actual commands & the resulting output from the command prompt:

-------------------------------------------------------------------------------------------------

C:\>c:\00\nconvert.exe -out tiff -binary nodither -c 7 -o c:\00\out\%.tif c:\00\test.tif
** NCONVERT v4.86 (c) 1991-2007 Pierre-E Gougelet (Jan 29 2008/13:24:04) **
Version for Windows NT/9x/2000/Xp/Vista (All rights reserved)
** This is a freeware software (for non commercial use)

Conversion of c:\00\test.tif into c:\00\out\test.tif OK

-------------------------------------------------------------------------------------------------

C:\>c:\00\nconvert.exe -out tiff -multi -binary nodither -c 7 -o c:\00\out\%.tif c:\00\test.tif
** NCONVERT v4.86 (c) 1991-2007 Pierre-E Gougelet (Jan 29 2008/13:24:04) **
Version for Windows NT/9x/2000/Xp/Vista (All rights reserved)
** This is a freeware software (for non commercial use)

Conversion of c:\00\test.tif into c:\00\out\%.tif OK
Conversion of c:\00\test.tif into c:\00\out\%.tif OK
Conversion of c:\00\test.tif into c:\00\out\%.tif OK
Conversion of c:\00\test.tif into c:\00\out\%.tif OK

-------------------------------------------------------------------------------------------------

C:\>c:\00\nconvert.exe -out tiff -xall -binary nodither -c 7 -o c:\00\out\%.tif c:\00\test.tif
** NCONVERT v4.86 (c) 1991-2007 Pierre-E Gougelet (Jan 29 2008/13:24:04) **
Version for Windows NT/9x/2000/Xp/Vista (All rights reserved)
** This is a freeware software (for non commercial use)

Conversion of c:\00\test.tif into c:\00\out\%-0.tif OK
Conversion of c:\00\test.tif into c:\00\out\%-1.tif OK
Conversion of c:\00\test.tif into c:\00\out\%-2.tif OK
Conversion of c:\00\test.tif into c:\00\out\%-3.tif OK

-------------------------------------------------------------------------------------------------

Each of these created the expected files, but the file names were not as expected.

Thank you for your attention.
Mango Juice

Post by Mango Juice »

Georgef: I'm unsure, but if you're doing ONLY one file you do not need to use the % symbol. If you want to change multiple files, then you should use % and * respectively.

Give it a try. Even if you only have test.tif available in the 'source' folder, instead of specifying the file name go *.tif, and see if it works!

Cheers :)