Merge file list in batch

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

Merge file list in batch

Postby 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: 3360
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Merge file list in batch

Postby 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

Postby 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: 3360
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Merge file list in batch

Postby 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: 10
Joined: Wed Mar 22, 2017 9:42 am

Re: Merge file list in batch

Postby 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

Postby 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: 10
Joined: Wed Mar 22, 2017 9:42 am

Re: Merge file list in batch

Postby 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%


Return to “Questions”

Who is online

Users browsing this forum: No registered users and 4 guests