Search found 129 matches

by mirrormirror
29 Jul 2016 16:06
Forum: DOS Batch Forum
Topic: function to write any string to a text file without manual escaping
Replies: 6
Views: 6816

Re: function to write any string to a text file without manual escaping

First the redirect character then the filename

:oops: - maybe I have the onset of dyslexia !
Thank you - this is simple and easy. I thought certain characters would cause issues with redirection to a file but I guess I am wrong. Maybe I am getting redirect confused with pipe...
by mirrormirror
29 Jul 2016 15:50
Forum: DOS Batch Forum
Topic: function to write any string to a text file without manual escaping
Replies: 6
Views: 6816

Re: function to write any string to a text file without manual escaping

One of the issues I run across is that I can read text lines from files fine but sometimes can't write out those same lines. I tried your example using this string but get the error you see in the output below: @ECHO OFF &SETLocal DISABLEDelayedExpansion FOR /F "tokens=* delims=" %%a I...
by mirrormirror
29 Jul 2016 15:03
Forum: DOS Batch Forum
Topic: need help parsing output
Replies: 25
Views: 17457

Re: need help parsing output

I've already said my bit and I'm just commenting that piecemeal adjusting of code is not very satisfying for the helpers. It's seeing an overview of a task and then coding to get the job done - is what many helpers find enjoyable. I guess you could split my proccess into two parts. 1: data declarat...
by mirrormirror
28 Jul 2016 19:39
Forum: DOS Batch Forum
Topic: Macros with parameters appended
Replies: 29
Views: 50622

Re: Macros with parameters appended

I'm working to get my head around macros and just wanted to ask if this thread contained the most recent developments / syntax conventions that you guys use. In particular, I'm relying on this post: http://www.dostips.com/forum/viewtopic.php?f=3&t=2518#p12045 and hoping the info. is up to date. ...
by mirrormirror
28 Jul 2016 18:40
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.6 - regex text processor with support for text highlighting and alternate character sets
Replies: 550
Views: 2008186

Re: JREPL.BAT - regex text processor - successor to REPL.BAT

You couldn't take the time to read the documentation or any of the countless examples within this thread sorry - I skimmed through the documentation, found the /V option and simply focused on that and stopped there. I've been trying to understand macros in order to get a couple of them written befo...
by mirrormirror
28 Jul 2016 17:32
Forum: DOS Batch Forum
Topic: question on "global" FOR variables.
Replies: 3
Views: 4717

question on "global" FOR variables.

This is from the help output of "for /?" Remember, FOR variables are single-letter, case sensitive, global, and you can't have more than 52 total active at any one time. Can anyone explain what this means in practice? For example running the following code using %%a in consecutive loops se...
by mirrormirror
28 Jul 2016 17:16
Forum: DOS Batch Forum
Topic: function to write any string to a text file without manual escaping
Replies: 6
Views: 6816

function to write any string to a text file without manual escaping

sorry for all of the posts today - just asking a bunch of questions that have been on the backburner... Looking for a function or macro that can safely write all strings to a text file - without having to manually escape characters. For example: set "x=1% 2% 3% 4^% 5% ) == & =. a! b! < c! d...
by mirrormirror
28 Jul 2016 16:40
Forum: DOS Batch Forum
Topic: batch library usage / methodology question.
Replies: 2
Views: 2949

batch library usage / methodology question.

How do you guys handle your libraries of functions/macros/utilities? A couple of the types of things I'm looking for are: 1. How do you deal with updating shared macros/functions, etc. when your existing scripts (which rely on these) are working perfectly fine - when updating the shared code can ris...
by mirrormirror
28 Jul 2016 16:26
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.6 - regex text processor with support for text highlighting and alternate character sets
Replies: 550
Views: 2008186

Re: JREPL.BAT - regex text processor - successor to REPL.BAT

Hello Dave, I have a feature request for your next release of jrepl Based on my most recent help request in this forum here: http://www.dostips.com/forum/viewtopic.php?f=3&t=6044&start=195#p47986 Could you add a straight text SEARCH / REPLACE without using regex? Based on my prior issue wher...
by mirrormirror
28 Jul 2016 15:53
Forum: DOS Batch Forum
Topic: Simple debug trick
Replies: 2
Views: 3019

Simple debug trick

I'm sure many of you guys use something like this but I thought I'd pass it along in case it helps someone (it helps me ). I use the following technique when writing scripts in order to get verbose output when I want and to simply turn it off when I don't want all the clutter: set lvlVerbose=0 SET &...
by mirrormirror
28 Jul 2016 15:39
Forum: DOS Batch Forum
Topic: need help parsing output
Replies: 25
Views: 17457

Re: need help parsing output

foxdrive, I tried out the code and it appears to work! I was skeptical that it could handle folders with special characters but my "test folder" passed: "folder = T:\aT1\1% 2% 3% 4^% 5% ) == & =. a! b! c! d^! e! ^ ^ 'n1 = n +2 -( )))" BUILTIN\Administrators:(I)(F) BUILTIN\Adm...
by mirrormirror
28 Jul 2016 14:56
Forum: DOS Batch Forum
Topic: Vars over endlocal - return.bat / macro use?
Replies: 9
Views: 8543

Re: Vars over endlocal - return.bat / macro use?

Soo, I will complete the macro code at SO:
Awesome! Thank you - I will be looking forward to it :)
by mirrormirror
28 Jul 2016 00:36
Forum: DOS Batch Forum
Topic: Vars over endlocal - return.bat / macro use?
Replies: 9
Views: 8543

Re: Vars over endlocal - return.bat / macro use?

At SO:preserving exclamation marks in variable between setlocals batch is a good example why you need it and how to use it. Link: http://stackoverflow.com/questions/29869394/preserving-exclamation-marks-in-variable-between-setlocals-batch Hi jeb, I have a question on the macro you linked over @SO (...
by mirrormirror
27 Jul 2016 22:33
Forum: DOS Batch Forum
Topic: Adding tags to file
Replies: 9
Views: 11758

Re: Adding tags to file

FYI, the newer versions of 7-zip are ADS aware and can archive them in certain types of archives - search for "streams" in the histoory log:
[url]http://www.7-zip.org/history.txt[/url]
by mirrormirror
27 Jul 2016 22:29
Forum: DOS Batch Forum
Topic: need help parsing output
Replies: 25
Views: 17457

Re: need help parsing output

Thanks penpen & aGerman for the info - I've incorporated these updates into my code. That path line in your sample text isn't normally there in icacls output is it? It is there, but only in the first line of output - that is the line I was asking for advice in how to parse out: C:\>icacls "...