delete space from result name

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

Moderators: XnTriq, helmut, xnview

bunak
Posts: 4
Joined: Sun Jun 02, 2013 10:53 am

delete space from result name

Post by bunak »

Hi
I do batch convert images to png. But some source images have space in name (for example "1233 .bmp"). Is it possible delete/remove space from name when NConvert convert it (to "1233.bmp")?

Now my command look like this

Code: Select all

nconvert.exe -D -out png *.*
after finish converting i use cmd scripts for remove space from names.

Code: Select all

FOR /R d:\Project-Result\Img %%f IN (*) DO CALL:REN "%%f"
goto:eof

:: :REN    - subfunction
:: %~nxI   - expands %I to a file name and extension only

:REN
set "file=%~nx1"
ren %1 %file: =%
But, it is Better if space will remove when NConvert converting images.
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Re: delete space from result name

Post by oops66 »

Hello,
FI: ... For me, it's better to replace spaces in filenames with underscores. (for readability)
XnViewMP Linux X64 - Debian - X64
cday
XnThusiast
Posts: 4307
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: delete space from result name

Post by cday »

bunak asked:

Is it possible to delete/remove space from name when NConvert convert it (to "1233.bmp")?
I don't think so.

But as NConvert can process a folder of images, maybe a batch file .bat that first calls NConvert then calls your cmd.exe script?

Note: No spaces in paths allowed if wildcards are used in file names.