Search found 12 matches

by TMC
02 May 2019 07:31
Forum: DOS Batch Forum
Topic: For Loop: Iteratively add strings to a variable
Replies: 2
Views: 3227

Re: For Loop: Iteratively add strings to a variable

Solution is:

First Loop to empty "filesToMerge" variable for every folder

Code: Select all

set "filesToMerge="
second loop add the new filepath to the variable "filesToMerge" without overwriting existing content

Code: Select all

set "filesToMerge=!filesToMerge! -O %%F"
Best Tobias
by TMC
02 May 2019 02:58
Forum: DOS Batch Forum
Topic: Get Parent Directory as a variable
Replies: 6
Views: 13995

Re: Get Parent Directory as a variable

The full code is in my first post. It is the last code block. I tried to use delayed expansion but it didn't work either... I guess I'm doing something wrong, but unfortunately I don't have time for this until the weekend. I'll try to work out a minimal working code snipped so you guys can try this ...
by TMC
01 May 2019 12:30
Forum: DOS Batch Forum
Topic: For Loop: Iteratively add strings to a variable
Replies: 2
Views: 3227

For Loop: Iteratively add strings to a variable

Dear Forum, as I stated in my other post : https://www.dostips.com/forum/viewtopic.php?f=3&t=9116 I'm trying to process files in many sub folders. I came up with this short script in the last few hours which does almost everything I want. @echo off SetLocal ENABLEDELAYEDEXPANSION rem define original...
by TMC
01 May 2019 09:37
Forum: DOS Batch Forum
Topic: Get Parent Directory as a variable
Replies: 6
Views: 13995

Re: Get Parent Directory as a variable

If I change to line to echo -SAVE_CLOUDS ALL_AT_ONCE FILE: "C:\04_merged\%a%" no file is exported as the variable "a" seems to bee empty. Even if I try o hardcode the variable a in the following manner: for %%f in (%*) DO set a=5.bin echo|set /p=-O %%f >>01_save_clouds_at_once.bat It wont take the v...
by TMC
01 May 2019 09:06
Forum: DOS Batch Forum
Topic: Get Parent Directory as a variable
Replies: 6
Views: 13995

Re: Get Parent Directory as a variable

Thank you for your tip, but I thought I already did found a solution to get the parent of an folder: for %%i in (%%CD%%) DO set a=%%~ni So my question remains: how do I pass the variable "a" to the next line? echo -SAVE_CLOUDS ALL_AT_ONCE FILE: "C:\04_merged\%%a" I tried "SetLocal EnableDelayedExpan...
by TMC
01 May 2019 08:29
Forum: DOS Batch Forum
Topic: SET variable and MKDIR in one line? Automate a process
Replies: 7
Views: 7883

Re: SET variable and MKDIR in one line? Automate a process

Dear Phil,

thank you again for your time! Most appreciated!

This is working perfectly, although I must admit, that I have some trouble to understand the changes you made.
Somehow CMD language has a quite steep learning curve, at least for me.

Best Tobias
by TMC
01 May 2019 07:49
Forum: DOS Batch Forum
Topic: Get Parent Directory as a variable
Replies: 6
Views: 13995

Get Parent Directory as a variable

Dear Forum, I wrote a small batch script in which I want to merge point clouds. Code: 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_ON...
by TMC
24 Apr 2019 06:31
Forum: DOS Batch Forum
Topic: SET variable and MKDIR in one line? Automate a process
Replies: 7
Views: 7883

Re: SET variable and MKDIR in one line? Automate a process

Alright, I tryied a bit on my own and I came to a really "dirty" solution. I hope someone is kind enough to help me clean this code a little bit up :) that would be awesome. for /f "usebackQ tokens=1,* delims= " %%i in ("C:\vertices\vertices.txt") do call :cropFile %%j echo %%* echo done pause exit ...
by TMC
24 Apr 2019 05:47
Forum: DOS Batch Forum
Topic: SET variable and MKDIR in one line? Automate a process
Replies: 7
Views: 7883

Re: SET variable and MKDIR in one line? Automate a process

Well after trying to change the code a little I encountered a different problem. It seems like that the vertices are stored not individually but in one variable, so %* looks like the following: x1,y1,x2,y2...x6,y6 - so the commas (delimiters are stored as well). But cloud compare needs them to be de...
by TMC
24 Apr 2019 05:06
Forum: DOS Batch Forum
Topic: SET variable and MKDIR in one line? Automate a process
Replies: 7
Views: 7883

Re: SET variable and MKDIR in one line? Automate a process

Dear Phil, the script is doing nearly what I want. But it seems that the script is taking the ID as the file name. But filename and ID are different things. The ID is the "name" of the cropped area, the filename after cropping should stay the same. Let me try to explain in more detail: In the folder...
by TMC
23 Apr 2019 10:10
Forum: DOS Batch Forum
Topic: SET variable and MKDIR in one line? Automate a process
Replies: 7
Views: 7883

Re: SET variable and MKDIR in one line? Automate a process

Dear Phil, I have to admit - I had to read the text five times to understand what you want. Now I'm behind it. I'm sorry for the confusion. English is not my native language, but I'm happy that you got what I want to achieve. I hoped, that the pseudocode would explain the most part of what I want to...
by TMC
19 Apr 2019 08:36
Forum: DOS Batch Forum
Topic: SET variable and MKDIR in one line? Automate a process
Replies: 7
Views: 7883

SET variable and MKDIR in one line? Automate a process

Dear Forum, I'm in need of some help with a command line I use to crop point cloud data. The software I want to use provides a very good command line mode (CloudCompare). So I wrote a little CMD one liner which is almost doing everything I want, but now I want to automate this process. First I'm goi...