I wrote a small batch script in which I want to merge point clouds.
Code:
Code: Select all
echo|set /p= ""C:\Program Files\CloudCompare\cloudcompare.exe" -SILENT -C_EXPORT_FMT BIN " > 01_save_clouds_at_once.bat
for %%f in (%*) DO echo|set /p=-O %%f >>01_save_clouds_at_once.bat
echo -SAVE_CLOUDS ALL_AT_ONCE FILE: "C:\04_merged\FileName.bin" >>01_save_clouds_at_once.bat
01_save_clouds_at_once.bat
But I have to hard code the file name ["C:\04_merged\FileName.bin"]. Is there a way to soft code the file name?
The original files (couple hundreds) are in an folder ["C:\03_output\ID\original_files.bin"], whereas the ID is a number (e.g 5 or 7 or 99.1 or 344).
So I thought I get the parent of the original file with this line:
Code: Select all
for %%i in (%%CD%%) DO set a=%%~ni
Code: Select all
for %%i in (%%CD%%) DO set a=%%~ni.bin
But If I want to implement this line into my script it is not recognizing the variable "a" as a variable.
Code:
Code: Select all
echo|set /p= ""C:\Program Files\CloudCompare\cloudcompare.exe" -SILENT -C_EXPORT_FMT BIN " > 01_save_clouds_at_once.bat
for %%f in (%*) DO for %%i in (%%CD%%) DO set a=%%~ni.bin echo|set /p=-O %%f >>01_save_clouds_at_once.bat
echo -SAVE_CLOUDS ALL_AT_ONCE FILE: "C:\04_merged\%%a" >>01_save_clouds_at_once.bat
01_save_clouds_at_once.bat
I hope you guys have any sugesstions.
Best Tobias