Search found 212 matches

by darioit
11 Oct 2014 00:55
Forum: DOS Batch Forum
Topic: Merge 2 script variable problem
Replies: 2
Views: 1273

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: 5053

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: 5053

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: 5053

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: 5053

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: 5053

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: 5053

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: 1595

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: 1595

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: 1165

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: 1198

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...
by darioit
19 Aug 2014 01:57
Forum: DOS Batch Forum
Topic: Clean char / and & in a string
Replies: 2
Views: 1429

Re: Clean char / and & in a string

oh thanks I use "!" in all variable of this batch, but here I get a template for this site and I forget to change % in ! lol
by darioit
19 Aug 2014 01:03
Forum: DOS Batch Forum
Topic: Clean char / and & in a string
Replies: 2
Views: 1429

Clean char / and & in a string

Hello everybody, I find a new issue that need your help, here my question: I read a string formed by letters and symbol like / and & This string is fixed long 50 chars My goal is to clean "/" and "&" before use this string to create a new folders This is input file: Best ...
by darioit
19 Jun 2014 09:13
Forum: DOS Batch Forum
Topic: Problem with Quote character
Replies: 4
Views: 1773

Re: Problem with Quote character

yes because I must split big Xml file in a little one, and I have a header "fix" long 9 byte to create a new xml, but I must read each line