Page 1 of 1

Merge file list in batch

Posted: Wed Sep 20, 2017 10:40 am
by skarab
Hello,

It's the my first try in batch on CC and I'm asking if it's possible to merge some files wich path is store in a .txt file.

I try the command

Code: Select all

for /f "delims=" %%i in (Files_list.txt) do cloudcompare.exe -o %%i -merge_clouds
But it seem that it doesn't work. Files are well opened but not merged.

Do you have an idea ?

Re: Merge file list in batch

Posted: Thu Sep 21, 2017 6:24 pm
by daniel
Indeed, this is clearly not supported by the command line mode. You would need to be able to expand the list of filenames as a string first and then insert it in the command line (I just don't know if it's possible ;).

You need something that generates the command like this:
CloudCompare -o file1 -o file2 -o file3 -merge_clouds

Re: Merge file list in batch

Posted: Fri Sep 22, 2017 10:03 am
by DimitriDimitri
Hi,

Using the below command line:

CloudCompare -C_EXPORT_FMT PCD -O C:\Users\user\Desktop\ToMerge\frame_0002.pts -O C:\Users\user\Desktop\ToMerge\frame_0079.pts -MERGE_CLOUDS

Both files open correctly, but they do not merge.

Am I doing anything wrong?

Thanks!

Re: Merge file list in batch

Posted: Fri Sep 22, 2017 10:08 am
by daniel
Do you have a screen capture of the console output? The merge cloud should be automatically saved by default.

Re: Merge file list in batch

Posted: Wed Sep 27, 2017 8:04 am
by skarab
daniel wrote:You need something that generates the command like this:
CloudCompare -o file1 -o file2 -o file3 -merge_clouds
You're right. I finally found with something like that. I set the -o file1 -o file2 -o file3 in a variable and i call him into the command. It work fine and it avoid me to overload my memory

Re: Merge file list in batch

Posted: Sat Sep 30, 2017 9:55 am
by framed
Hi skarab, can you please share how you set the file name list as a variable for use in the CloudCompare command?

Re: Merge file list in batch

Posted: Fri Oct 20, 2017 7:53 am
by skarab
It's probably not the cleanest way but I create a .txt file with a dir and then i did this :

Code: Select all

for /f "delims=" %%i in (%fdir%\Files_list.txt) do call :concat %%i
cloudcompare.exe %file_list% -merge_clouds -SS spatial 0.005
del %fdir%\Files_list.txt
goto :eof

:concat
set file_list=%file_list% -o %1
rem echo %file_list%

Re: Merge file list in batch

Posted: Fri Aug 03, 2018 10:50 am
by swiss_knight
In *Nix systems, one can first append files names in a variable, let call it 'files':

Code: Select all

$ for f in folder_name/*.ply; do files+="-O ${f} "; done
Then pass this variable to CloudCompare:

Code: Select all

$ CloudCompare -SILENT -NO_TIMESTAMP -C_EXPORT_FMT PLY ${files} -MERGE_CLOUDS

That's it.