Search found 14 matches

by Bucko
24 Jun 2018 14:29
Forum: DOS Batch Forum
Topic: String generated from CL parameters...
Replies: 9
Views: 6282

Re: String generated from CL parameters...

Steffen, I am overwhelmed! Thank you very much! "You never answered my question of my first reply." Yes, my fault. However, in my case this was irrelevant, the string composition was just an example, only the parameter parts are relevant for my batch file. Sorry... In the meantime I found another pr...
by Bucko
24 Jun 2018 09:21
Forum: DOS Batch Forum
Topic: String generated from CL parameters...
Replies: 9
Views: 6282

Re: String generated from CL parameters...

Works like a charm! Danke!!!
by Bucko
24 Jun 2018 07:17
Forum: DOS Batch Forum
Topic: String generated from CL parameters...
Replies: 9
Views: 6282

Re: String generated from CL parameters...

OK, Steffen, my last problem: @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION set "str=<Result><%1><Two:%~2><Three:%~3>|" echo !str! REM Works fine: >"Result.txt" echo !str! REM Output to a Unicode file: cmd /u /c "echo "!str!">ResultU.txt" This last line works with quotes in "!str!", but then there are q...
by Bucko
24 Jun 2018 05:41
Forum: DOS Batch Forum
Topic: String generated from CL parameters...
Replies: 9
Views: 6282

Re: String generated from CL parameters...

Danke, Steffen! Tilde, that's fine! It removes DQ from parameters. But my str is stil in DG, how to remove them? @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION set str="<Result><%1><Two:%~2><Three:%~3>|" echo %str% echo %str% > Result.txt REM cmd /u /c "echo %str% > Result.txt" echo writes to Result.txt....
by Bucko
24 Jun 2018 04:42
Forum: DOS Batch Forum
Topic: String generated from CL parameters...
Replies: 9
Views: 6282

String generated from CL parameters...

I would like to run a batch file via a command line with three parameters like this (e.g.): Test.bat 99 "Par 2" "Par 3" The batch file should generate a string composed from the parameters: <Result><99><Two:Par 2><Three:Par 3>| How this can be done? I have some success with my attempts, but I can no...
by Bucko
18 Jun 2018 09:45
Forum: DOS Batch Forum
Topic: Findstr without pipe
Replies: 3
Views: 4166

Re: Findstr without pipe

There is no way that you get what you want from findstr command, no matters how many times you ask the same question... Thank you, Aacini, I appreciate your help very much. Yes, this is my third question related to findstr, but it is not the same question. This one is the most reduced one, associat...
by Bucko
18 Jun 2018 01:12
Forum: DOS Batch Forum
Topic: Findstr without pipe
Replies: 3
Views: 4166

Findstr without pipe

I am using a this batch script to extract a part of a binary file following a delimiter string: @echo off setlocal enabledelayedexpansion REM Line number of the delimiter line: for /F "delims=:" %%a in ('findstr /N "^xxyyzz" "Input.bin"') do set "lines=%%a" echo %lines% REM Extract the part of the I...
by Bucko
10 Jun 2018 00:41
Forum: DOS Batch Forum
Topic: Unable to understand how to use findstr...
Replies: 9
Views: 8894

Re: Unable to understand how to use findstr...

That's just fantastic, misol101! It does not solve my problem with using findstr (and I still hope someone will show me a solution), but: Your answer allows me to think of a very different concept for my general project. I did not know that C and TCC make it possible to write such extremely small p...
by Bucko
09 Jun 2018 13:16
Forum: DOS Batch Forum
Topic: Unable to understand how to use findstr...
Replies: 9
Views: 8894

Re: Unable to understand how to use findstr...

I tested this, yes, and it doesn't work, as I said (nul character is ignored). This discussion only removes us from my question from the beginning.
by Bucko
09 Jun 2018 12:22
Forum: DOS Batch Forum
Topic: Unable to understand how to use findstr...
Replies: 9
Views: 8894

Re: Unable to understand how to use findstr...

ShadowThief, thank you very much for your support! You address questions which are not directly relevant to my setting. All my binary files (which I intend to use) have "lines" (i.e. newline characters), and these "lines" are not to long for findstr (there is a length limit). So findstr definitely w...
by Bucko
09 Jun 2018 08:07
Forum: DOS Batch Forum
Topic: A simple way to join/unjoin files
Replies: 4
Views: 4992

Re: A simple way to join/unjoin files

Thank you very much, penpen! The delimiter string was just an example, of course a more sofisticated string can be used. Yes, findstr is able to process binary "strings"! There are some limitations, but the method works. I see that nobody here can give me an answer, so I posted a new question limite...
by Bucko
09 Jun 2018 08:00
Forum: DOS Batch Forum
Topic: Unable to understand how to use findstr...
Replies: 9
Views: 8894

Unable to understand how to use findstr...

My mental abilities are not enough :wink: to understand how findstr should be used to extract a part of a text file, more precisely all lines from line number n to line number m , from a text file into an output file. Could someone here help me? Please note that my question is limited to findstr , b...
by Bucko
05 Jun 2018 21:30
Forum: DOS Batch Forum
Topic: A simple way to join/unjoin files
Replies: 4
Views: 4992

Re: A simple way to join/unjoin files

If the above is impossible or too complex, at least the following should be achieved: If Combined.exe contains only one delimiter string: copy /b Binary1.exe + /a Delimiter.txt + /b Binary2.exe /b Combined.exe only the binary part after this string (Binary2.exe) should be extracted. That means that ...
by Bucko
05 Jun 2018 01:54
Forum: DOS Batch Forum
Topic: A simple way to join/unjoin files
Replies: 4
Views: 4992

A simple way to join/unjoin files

There is a simple way to concatenate files by a DOS command: copy /a Batch.bat + /b Binary.exe /b Combined.bat *) An there is a way to "unconcatenate" such a Combined.bat by a DOS command: If Batch.bat consists only of lines starting with e.g. ";;==,," (this doesn't affect the execution of the bat!)...