Search found 230 matches

by darioit
10 Sep 2015 04:31
Forum: DOS Batch Forum
Topic: Set Conter 5 digit
Replies: 2
Views: 3013

Set Conter 5 digit

Hello folks, I have this simply work, add 1 unit to my file Counter.txt, but digit must be 5 digit fix (ex.00023) This is my script, but when decimal is moving from 1 position doesn't works, any idea? echo on setlocal EnableDelayedExpansion set Counter=0 FOR /f "tokens=1" %%i in (Counter.t...
by darioit
21 Oct 2014 01:49
Forum: DOS Batch Forum
Topic: Random number
Replies: 1
Views: 2448

Random number

Hello, I use this variable %random% to get random number, but the result must be always 5 byte @echo off echo %random% echo %random% echo %random% echo %random% echo %random% echo %random% echo %random% echo %random% echo %random% echo %random% result: 14915 15875 3294 (results must be 03294) 17197 ...
by darioit
21 Oct 2014 01:46
Forum: DOS Batch Forum
Topic: Merge 2 script variable problem
Replies: 2
Views: 2936

Re: Merge 2 script variable problem

nice work, thank you !
by darioit
11 Oct 2014 00:55
Forum: DOS Batch Forum
Topic: Merge 2 script variable problem
Replies: 2
Views: 2936

Merge 2 script variable problem

Hello everybody, I need to merge 2 script but I'm in big trouble with variable, I hope you give me right solution Basically this 2 scripts access to same information "cc_debug.txt" at same time, so it's better merge it I try to do it, but I can't solve problem of variable I also use a ! be...
by darioit
01 Oct 2014 09:07
Forum: DOS Batch Forum
Topic: Remove quote in xml file
Replies: 12
Views: 10155

Re: Remove quote in xml file

I mean the complete code echo off setlocal enableDelayedExpansion set /a record=-1 for /l %%# in () do ( set /a "1/((record+=1)%%20)" 2>nul || ( for /f "tokens=1-6 delims=/,.: " %%A in ("!date! !time: =0!") do ( set "MenTime=<MenTime>%%A/%%B/%%C %%D:%%E:%%F</MenTim...
by darioit
01 Oct 2014 02:47
Forum: DOS Batch Forum
Topic: Remove quote in xml file
Replies: 12
Views: 10155

Re: Remove quote in xml file

Hello, I find a problem, in this cicle of 20, variable "time" never change, it change only when a cicle is finished for /l %%# in () do ( set /a "1/((record+=1)%%20)" 2>nul || ( for /f "tokens=1-6 delims=/,.: " %%A in ("!date! !time: =0!") do ( set "MenTi...
by darioit
30 Sep 2014 02:35
Forum: DOS Batch Forum
Topic: Remove quote in xml file
Replies: 12
Views: 10155

Re: Remove quote in xml file

Hello everybody, Now I must merge this script with another one, because does not make sense have 2 script for same purpose This is new script that update a rrd db for /F %%a in ('tail -n1 C:\Meniscus\Xml\cc_debug.txt ^| find "<watts>"') do call set row="%%a" set TEMP=%row:~71,4% ...
by darioit
29 Sep 2014 02:24
Forum: DOS Batch Forum
Topic: Remove quote in xml file
Replies: 12
Views: 10155

Re: Remove quote in xml file

Hello, I try your code, but there's a little problem with time, it is show as "10:21:09,64", but I not use millisecond, so I try this command "%%F:~0,2" to gen only second "09" but it doesn't work, could you please help me?

Thanks and Regards
by darioit
28 Sep 2014 10:57
Forum: DOS Batch Forum
Topic: Remove quote in xml file
Replies: 12
Views: 10155

Re: Remove quote in xml file

Mr. dbenham, as Shakespeare says in one of his tragedy, you write code "by the book!" Many thanks!
by darioit
28 Sep 2014 02:05
Forum: DOS Batch Forum
Topic: Remove quote in xml file
Replies: 12
Views: 10155

Remove quote in xml file

Hello everybody I have this file C:\Meniscus\Xml\cc_debug.txt that contain <msg><src>CC128-v0.11</src><dsb>01598</dsb><time>09:56:48</time><tmpr>23.1</tmpr><sensor>0</sensor><id>00077</id><type>1</type><ch1><watts>00271</watts></ch1></msg> <msg><src>CC128-v0.11</src><dsb>01598</dsb><time>09:56:54</t...
by darioit
26 Sep 2014 07:05
Forum: DOS Batch Forum
Topic: synchro data processing
Replies: 2
Views: 3202

Re: synchro data processing

Thanks for reply, I do many many test and I find the problem was the command "TYPE.EXE" insode cmd.com I dont't know the reason, but it's seems that have a polling of 20 seconds indipendent of serial port flow I replace "type.exe" with Python pyserial and now the flow is mutch be...
by darioit
24 Sep 2014 07:35
Forum: DOS Batch Forum
Topic: synchro data processing
Replies: 2
Views: 3202

synchro data processing

Hello Everybody, I want share with you my new milestone, but in this case is not strictly related to script problem, but a data flow, here my question in detail: My data comining from Serial Port Com1 about 15/20 seconds, but the interval is every 6 second, I show you: <msg><src>CC128-v0.11</src><ds...
by darioit
21 Sep 2014 03:27
Forum: DOS Batch Forum
Topic: Translate Perl to Dos
Replies: 1
Views: 2379

Translate Perl to Dos

Hello, I find this Perl code. # Reads data from a Current Cost device via serial port. use strict; use Device::SerialPort qw( :PARAM :STAT 0.07 ); my $PORT = "/dev/ttyS0"; my $ob = Device::SerialPort->new($PORT); $ob->baudrate(2400); $ob->write_settings; open(SERIAL, "+>$PORT"); ...
by darioit
09 Sep 2014 01:55
Forum: DOS Batch Forum
Topic: Expand Parameter Extension
Replies: 1
Views: 2347

Expand Parameter Extension

Hello, I try to expand variable %TEMP% only with Path %~p but doesn't work, could you please help me. Here my code: @echo off setlocal EnableDelayedExpansion rem My script will start from this path %SCRIPTS% set ORIGIN=%~d0\Home set SCRIPTS=%ORIGIN%\Scripts set INPUT=%ORIGIN%\Input set OUTPUT=%ORIGI...