Search found 152 matches

by siberia-man
19 Mar 2020 13:16
Forum: DOS Batch Forum
Topic: Using Double Pipe in IF command
Replies: 5
Views: 273

Re: Using Double Pipe in IF command

Batch syntax is extremely poor and doesn't support more complicated conditions.
You could try Conditionals on steroids which enables more benefits.
by siberia-man
14 Mar 2020 19:15
Forum: DOS Batch Forum
Topic: Get line with highest numerical string
Replies: 6
Views: 409

Re: Get line with highest numerical string

Also (in addition to dbeham's suggestion) the wsx tool can help you to get the required result: wsx /n /e:"m=LINE.match(/^outbox\/logs\/.*?(\d+)\.log$/)||next();n=Number(m[1]);if(n>max){max=n;str=LINE}" /begin:"str='';max=0" /end:"echo(str)" test.txt wsx /n /e:"m=LINE.match(/^outbox\/logs\/.*?(\d+)\...
by siberia-man
11 Mar 2020 09:03
Forum: DOS Batch Forum
Topic: [SOLVED] Using GNU grep in a Windows batch script?
Replies: 9
Views: 2023

Re: [SOLVED] Using GNU grep in a Windows batch script?

Replace this one:

Code: Select all

for %%f in ("%1") DO ... <name>%%f</name>@g" < "%%f" > "%%f.NAME"
with:

Code: Select all

for %%f in ("%~1") DO ... <name>%%~f</name>@g" < "%%~f" > "%%~f.NAME"
by siberia-man
06 Mar 2020 08:25
Forum: DOS Batch Forum
Topic: [SOLVED] [regex] Multiline seeking with (s)sed?
Replies: 8
Views: 1250

Re: [regex] Multiline seeking with (s)sed?

It could something like this: sed "s/></>\n</g" | sed "/<desc>.*<\/desc>/d; /<desc>/,/<\/desc>/d" Some explanation: 1. the first SED walks over all >< and inserts new line character \n between angle brackets 2. the second SED does two actions: 2.1 remove all lines having <desc> something </desc> 2.2...
by siberia-man
06 Mar 2020 07:28
Forum: DOS Batch Forum
Topic: [SOLVED] [regex] Multiline seeking with (s)sed?
Replies: 8
Views: 1250

Re: [regex] Multiline seeking with (s)sed?

As I said early If both <desc> and </desc> could be on the same line or on the same line with other tags you need something much more complicated There is workaround: sed "place each <desc> and </desc> completely to the separate lines" | sed "/<desc>/,/<\/desc>/d" You need only to invent this algor...
by siberia-man
05 Mar 2020 10:45
Forum: DOS Batch Forum
Topic: [SOLVED] [regex] Multiline seeking with (s)sed?
Replies: 8
Views: 1250

Re: [regex] Multiline seeking with (s)sed?

Assuming that the both <desc> and </desc> live alone in different lines (not in one line together), you can use the following command: sed "/<desc>/,/<\/desc>/d" If both <desc> and </desc> could be on the same line or on the same line with other tags you need something much more complicated. I hope ...
by siberia-man
05 Mar 2020 07:30
Forum: DOS Batch Forum
Topic: mshta command for copy into clipboard
Replies: 10
Views: 1555

Re: mshta command for copy into clipboard

I am not sure that anyone can help you with no knowing about your SW environment.
by siberia-man
05 Mar 2020 05:13
Forum: DOS Batch Forum
Topic: wsx.bat: REPL, one line program processor supporting some NodeJS features
Replies: 12
Views: 1793

Re: wsx.bat: REPL, one line program processor supporting some NodeJS features

Updates came to the first post. The tool version is the same but description is extended.
by siberia-man
05 Mar 2020 04:36
Forum: DOS Batch Forum
Topic: psubst: attempt to make virtual drives persistently
Replies: 0
Views: 1700

psubst: attempt to make virtual drives persistently

DESCRIPTION Times ago I invented the tool PSUBST being the extended version for the standard SUBST . Both tools allow to associate some paths with virtual drives. So executing the following command we have ability to achieve the particular path in two ways by the path itself and/or by the drive: su...
by siberia-man
05 Mar 2020 02:38
Forum: DOS Batch Forum
Topic: mshta command for copy into clipboard
Replies: 10
Views: 1555

Re: mshta command for copy into clipboard

Functionality of clipboardData and its method setData is strongly restricted by MSIE. Indeed, try using clip.
by siberia-man
02 Mar 2020 12:57
Forum: DOS Batch Forum
Topic: wsx.bat: REPL, one line program processor supporting some NodeJS features
Replies: 12
Views: 1793

Re: wsx.bat: REPL, one line program processor supporting some NodeJS features

I see your point. I need to step back and try to explain everything clearly as much as possible. I'll come back with the updated version of the tool in the first post.
by siberia-man
02 Mar 2020 07:53
Forum: DOS Batch Forum
Topic: mshta command for copy into clipboard
Replies: 10
Views: 1555

Re: mshta command for copy into clipboard

For long time (I don't know exactly since when) Windows is already shipped with the "clip" tool: C:\>clip /? CLIP Description: Redirects output of command line tools to the Windows clipboard. This text output can then be pasted into other programs. Parameter List: /? Displays this help message. Exam...
by siberia-man
02 Mar 2020 02:41
Forum: DOS Batch Forum
Topic: wsx.bat: REPL, one line program processor supporting some NodeJS features
Replies: 12
Views: 1793

Re: wsx.bat: REPL, one line program processor supporting some NodeJS features

As you can find -- everything is optional. If you enter an one line program, everything after is assumed as a file for processing. Each argument is opened as a file and processed line by line until EOF. wsx /n /e:"..." file1 file2 ... Otherwise. If you don't enter one line programs, the first item o...
by siberia-man
29 Feb 2020 19:39
Forum: DOS Batch Forum
Topic: wsx.bat: REPL, one line program processor supporting some NodeJS features
Replies: 12
Views: 1793

Re: wsx.bat: REPL, one line program processor supporting some NodeJS features

to have a switch for the input and output Not agree. Additional switches make usage more complicated. But this is not fully your issue -- I think it is on my side in majority of cases because I can't immediately give complete and/or comprehensive explanation. In my vision the good tool is a pipe co...
by siberia-man
29 Feb 2020 18:26
Forum: DOS Batch Forum
Topic: wsx.bat: REPL, one line program processor supporting some NodeJS features
Replies: 12
Views: 1793

Re: wsx.bat: REPL, one line program processor supporting some NodeJS features

No problem. Asking question is OK. They help to improve description. Let me know about the issues you experienced, if they have occurred.