Search found 4 matches

by slavger
14 Feb 2017 03:48
Forum: DOS Batch Forum
Topic: Read and change last symbols in text file
Replies: 7
Views: 4125

Re: Read and change last symbols in text file

Squashman wrote:So you still do not understand delayed expansion inside a code block which is what we tried to explain to you already.


Already finished my script. :roll:

Thank you for your patience.
by slavger
13 Feb 2017 03:06
Forum: DOS Batch Forum
Topic: Read and change last symbols in text file
Replies: 7
Views: 4125

Re: Read and change last symbols in text file

Thanks guys. It works, but I find another issue - can't call a function from FOR loop. @echo off setlocal enabledelayedexpansion set a=5B set /a xx=0x%a% -0x2 call :dec2hex %xx% result echo DEC result %xx% echo HEX result %result% for /l %%i in ( 1 1 3) do ( set "var1=0x5%%i" set /a var2=v...
by slavger
11 Feb 2017 08:57
Forum: DOS Batch Forum
Topic: Read and change last symbols in text file
Replies: 7
Views: 4125

Re: Read and change last symbols in text file

Squashman wrote:You are inside a code block so environmental variables need to be referenced with delayed expansion.

Thanks, a lot. Can you share a simple explanation, of course if you have some free times? :oops:
Anyway thanks!
by slavger
10 Feb 2017 10:00
Forum: DOS Batch Forum
Topic: Read and change last symbols in text file
Replies: 7
Views: 4125

Read and change last symbols in text file

Hi guys, I'm trying to change some characters in txt file, but It's too difficult for my mind I have a text file with some data and I need to replace last hex numbers in each string - result should be = 0x5b - 0x02 (for first string respectively) 10.36.215.1 01 01 02 e0 36 76 d6 9f 5b 10.36.215.2 01...