Merge file list in batch

Feel free to ask any question here
Post Reply
skarab
Posts: 12
Joined: Wed Mar 22, 2017 9:42 am

Merge file list in batch

Post by skarab » Wed Sep 20, 2017 10:40 am

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 ?

daniel
Site Admin
Posts: 4150
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Merge file list in batch

Post by daniel » Thu Sep 21, 2017 6:24 pm

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
Daniel, CloudCompare admin

DimitriDimitri
Posts: 1
Joined: Fri Sep 22, 2017 9:58 am

Re: Merge file list in batch

Post by DimitriDimitri » Fri Sep 22, 2017 10:03 am

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!

daniel
Site Admin
Posts: 4150
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Merge file list in batch

Post by daniel » Fri Sep 22, 2017 10:08 am

Do you have a screen capture of the console output? The merge cloud should be automatically saved by default.
Daniel, CloudCompare admin

skarab
Posts: 12
Joined: Wed Mar 22, 2017 9:42 am

Re: Merge file list in batch

Post by skarab » Wed Sep 27, 2017 8:04 am

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

framed
Posts: 10
Joined: Wed Feb 25, 2015 1:23 am

Re: Merge file list in batch

Post by framed » Sat Sep 30, 2017 9:55 am

Hi skarab, can you please share how you set the file name list as a variable for use in the CloudCompare command?

skarab
Posts: 12
Joined: Wed Mar 22, 2017 9:42 am

Re: Merge file list in batch

Post by skarab » Fri Oct 20, 2017 7:53 am

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%

swiss_knight
Posts: 27
Joined: Sun Aug 30, 2015 12:11 pm

Re: Merge file list in batch

Post by swiss_knight » Fri Aug 03, 2018 10:50 am

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.

Post Reply