Search found 1059 matches

by jeb
14 Jan 2011 03:29
Forum: DOS Batch Forum
Topic: Output to text file
Replies: 13
Views: 19189

Re: Output to text file

Ok it is tricky. On the command line the set /a echo's also the result, but in the batch file it is quite. So you have to output explicit. setlocal EnableDelayedExpansion for /f "delims=:" %%i in ('certutil -v -store My ^| findstr /i /n "_ID(20)"') do ( set /a n=%%i+1 echo !n! ) ...
by jeb
10 Jan 2011 14:53
Forum: DOS Batch Forum
Topic: Output to text file
Replies: 13
Views: 19189

Re: Output to text file

You could put it into a batch file myFind.bat @echo off for /F "usebackq delims=" %%a in (`findstr %1 %2`) DO ( set "line=%%a" ) REM ** remove the line number, all characters to the first ":" set "line=%line:*:=%" REM ** remove all spaces set "line=%line:...
by jeb
04 Jan 2011 12:43
Forum: DOS Batch Forum
Topic: Output to text file
Replies: 13
Views: 19189

Re: Output to text file

Hmmm ?

You redirect it to a file (tmp.txt), so I don't understand what your question is?
by jeb
03 Jan 2011 17:31
Forum: DOS Batch Forum
Topic: Output to text file
Replies: 13
Views: 19189

Re: Output to text file

Hi A_Bobby,

this should work

Code: Select all

for /f "delims=:" %i in ('certutil -v -store My ^| findstr /i /n "_ID(20)"') do ( set /a n=%i+1 & echo( ) >>tmp.txt


The main problem was, that the output of the SET command is always without line end (CR/LF).

hope it helps
jeb
by jeb
20 Dec 2010 05:43
Forum: DOS Batch Forum
Topic: Search and Replace Quotes
Replies: 11
Views: 13292

Re: Search and Replace Quotes

Yes, findstr fails, because the last line have no line end.

you could replace the $ with ^^ in findstr, so it also finds the last line of a file.

Code: Select all

for /f "delims=" %%A in ('"findstr /n ^^ %3"') do (


jeb
by jeb
20 Dec 2010 03:58
Forum: DOS Batch Forum
Topic: Search and Replace Quotes
Replies: 11
Views: 13292

Re: Search and Replace Quotes

Ok, if you use the standard BatchSubstitute you can not replace single quotes, because it is not possible to create a cmd-line-parameter with a single quote. But you can use the improved Batchsubstitute http://www.dostips.com/forum/viewtopic.php?f=3&t=1516&p=5713 And use BatchSubstitute.bat ...
by jeb
19 Dec 2010 16:46
Forum: DOS Batch Forum
Topic: Search and Replace Quotes
Replies: 11
Views: 13292

Re: Search and Replace Quotes

Ok, but what do you try, that fails?

jeb
by jeb
19 Dec 2010 15:24
Forum: DOS Batch Forum
Topic: Search and Replace Quotes
Replies: 11
Views: 13292

Re: Search and Replace Quotes

Hi dragonfly,

do you tested anything, or do you only think about it?
I can't see any problems in removing all quotes, with the standard batch syntax.

jeb
by jeb
19 Dec 2010 13:07
Forum: DOS Batch Forum
Topic: BatchSubstitute Output Width
Replies: 5
Views: 6747

Re: BatchSubstitute Output Width

Hi JDV,

you could try the "improved Batch Substitute" http://www.dostips.com/forum/viewtopic.php?f=3&t=1516.

The problem seems to be the find command, it have problems with long lines.
findstr accept more characters.

jeb
by jeb
18 Dec 2010 04:53
Forum: DOS Batch Forum
Topic: BatchSubstitute Output Width
Replies: 5
Views: 6747

Re: BatchSubstitute Output Width

Hi JDV,

first have question.
Do you use the batch substitute from the library or the improved version from the forum?
Is your input file in ascii or unicode format?

Jeb
by jeb
11 Dec 2010 16:03
Forum: DOS Batch Forum
Topic: How to place the cursor
Replies: 1
Views: 3169

How to place the cursor

Hi, OK, I know the standard answer: It is not possible with pure batch. But some minor things are possible and well known. Like echoing into the same line with the set /p trick <nul set /p ".=This echos without CR-LF at the end <nul set /p ".=...This text is appended in the same line Then ...
by jeb
11 Dec 2010 16:02
Forum: DOS Batch Forum
Topic: C++ anyone?
Replies: 12
Views: 21566

Re: C++ anyone?

Hi maniacal, The problem occured when trying to calculate the total milliseconds passed today, which happens to be a very large number and thus set /a couldn't handle its size. A day have 86400 seconds, that are 86.400.000 milli seconds, that is a small number, even for the set /a arithmetic But it ...
by jeb
11 Dec 2010 13:15
Forum: DOS Batch Forum
Topic: Improved BatchSubstitute.bat
Replies: 7
Views: 17596

Re: Improved BatchSubstitute.bat

Hi aGerman,

the

Code: Select all

(echo(!line!)

The enclosing parenthesis are only to ensure, that after !line! is no extra/invisible space.


hope it helps
jeb (theOtherGerman)
by jeb
10 Dec 2010 05:16
Forum: DOS Batch Forum
Topic: Improved BatchSubstitute.bat
Replies: 7
Views: 17596

Improved BatchSubstitute.bat

Hi, the current BatchSubstitute.bat has several limitations - Lines starting with "]" character will end up empty - OldStr must not start with "*", "~" or "%", must not contain "=" - NewStr must not contain "%" - Lines must not contain any ...
by jeb
09 Dec 2010 06:16
Forum: DOS Batch Forum
Topic: Send variable from user input to text
Replies: 8
Views: 7598

Re: Send variable from user input to text

Hi myjet, you can solve this with delayed expansion, because the characters are not interpreted then. @echo off setlocal EnableDelayedExpansion echo Enter your question set /p question= echo %question% set "text=<satu><item soalan='%question%' jawapanA='A: " echo !text!>> Question1.xml exi...