Search found 127 matches

by mirrormirror
20 Jul 2016 18:10
Forum: DOS Batch Forum
Topic: heredoc in batch
Replies: 5
Views: 4223

Re: heredoc in batch

it doesn't work because you try to call the script by name and extension .bat. Try the same without extension.

Thank you siberia-man, it is working now.
by mirrormirror
20 Jul 2016 18:08
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 440
Views: 205065

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

I'd guess it depends on how those characters are being sent to Jrepl. Right now, I am only extracting sections of text from within files. And I am just looking for a consistent, reliable method that will work for all characters. I'd like to avoid tweaking the method and/or text format (i.e. escapin...
by mirrormirror
19 Jul 2016 17:41
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 440
Views: 205065

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

jrepl ":SQLFile_Begin\s*?\n([\s\S]*?)\r?\n:SQLFile_END" $1 /m /jmatch /f "%~f0" | jrepl "%%(.*?)%%" "env($1)?env($1):$0" /j /o "output.sql" This works perfect - thank you. Now for an advice question: I have some other scenarios where I need to gener...
by mirrormirror
19 Jul 2016 17:10
Forum: DOS Batch Forum
Topic: heredoc in batch
Replies: 5
Views: 4223

Re: heredoc in batch

Thank you for the reply. I've downloaded the file from the link you sent and the errors are now gone but it doesn't seem to work as expected: @ECHO OFF CALL heredoc.bat :testlabel1 & GOTO :testlabel1 SET DataFile=users.txt @ECHO BEGIN --------------------------------------------- :SQLFile_Begin ...
by mirrormirror
18 Jul 2016 19:50
Forum: DOS Batch Forum
Topic: Can anyone find the problem with this simple code?
Replies: 2
Views: 810

Re: Can anyone find the problem with this simple code?

I didn't look deeply at all but replace ) with ^) when you echo them within parentheses.


That fixed it - thanks.
by mirrormirror
18 Jul 2016 17:37
Forum: DOS Batch Forum
Topic: Can anyone find the problem with this simple code?
Replies: 2
Views: 810

Can anyone find the problem with this simple code?

It is probably a simple problem with parentheses ")" but I can't figure out exactly where the problem lies: @ECHO OFF SET "tmpImport1=dataRaw_Shares.txt" SET "tmpSQLImport1=Insert_Shares.sql" ( @ECHO DELETE FROM Shares; @ECHO DROP TABLE IF EXISTS tmpDataInsert; @ECHO CR...
by mirrormirror
18 Jul 2016 17:32
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 440
Views: 205065

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

Ok, I'm back with another question I'm trying to find an easy/standardized way to generate a few .sql files. Right now there is only one [%var%] that needs to be expanded. In the "printhere" and "heredoc" threads, I've been trying those solutions but none are perfect for what I n...
by mirrormirror
18 Jul 2016 17:14
Forum: DOS Batch Forum
Topic: heredoc in batch
Replies: 5
Views: 4223

Re: heredoc in batch

Hello Siberia-man, I was attempting to use your heredoc.bat but am not able to get it to work: @ECHO OFF @ECHO BEGIN --------------------------------------------- CALL heredoc.bat :testlabel1 & goto :testlabel1 DELETE FROM Users; DROP TABLE IF EXISTS tmpDataInsert; CREATE TEMP TABLE IF NOT EXIST...
by mirrormirror
18 Jul 2016 16:38
Forum: DOS Batch Forum
Topic: PrintHere.bat - an emulation of the unix here doc feature
Replies: 2
Views: 2776

Re: PrintHere.bat - an emulation of the unix here doc feature

Hi Dave, I know this is an older thread but I was trying out this utility and found a couple of issues in case you are interested: Issue #1: Empty lines are not echoed correctly if trimming spaces/tabs (or maybe all characters) @ECHO OFF @ECHO BEGIN --------------------------------------------- CALL...
by mirrormirror
01 Jul 2016 23:16
Forum: DOS Batch Forum
Topic: ECHO ON / OFF behavior within a loop
Replies: 2
Views: 1247

ECHO ON / OFF behavior within a loop

Does a FOR loop disable ECHO ON / OFF functionality, or "delay" it? Running this code looks like it should produce some screen output but I get nothing: @echo off & setlocal enableDelayedExpansion for /f "tokens=1,2 delims=: " %%A in ( 'ipconfig /all ^| jrepl "%srcIP%[\s...
by mirrormirror
01 Jul 2016 23:00
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 440
Views: 205065

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

Dave, thank you for the examples, they help out a lot. They both work great. I modified the 1st example to pull DNS servers associated with a specific IP: FOR /F "usebackq tokens=3,4" %%a IN (`route print 0.0.0.0 ^|findstr /C:"0.0.0.0"`) DO ( SET srcIP=%%b ) for /f "tokens=1...
by mirrormirror
01 Jul 2016 21:19
Forum: DOS Batch Forum
Topic: ChangeMACAddressBatch script
Replies: 1
Views: 1213

Re: ChangeMACAddressBatch script

Thank you for posting your script for us all. I currently do not have a use for it but will keep it in my library.
by mirrormirror
01 Jul 2016 18:23
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 440
Views: 205065

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

1. There can be more than one set of DNS servers in ipconfig /all such as belonging to other network items. Are you aware of that? You are right of course - and I did not take this into consideration. For now I think there is only one adapter on each box where this will run. I'll worry about multip...
by mirrormirror
01 Jul 2016 02:05
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 440
Views: 205065

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

Hey guys, I'm cleaning up a couple of older batch scripts and wondered if I might be able to use jRepl or FindRepl to take some bulk out of them. Here are a couple of examples: 1. One routine parses the output from "ipconfig /all" to get the "DNS Servers". I guess there can be 1 ...
by mirrormirror
26 Mar 2016 15:05
Forum: DOS Batch Forum
Topic: Creating an archive batch with embed code
Replies: 3
Views: 1289

Re: Creating an archive batch with embed code

If I understand what you are looking for, users here have already developed several methods for doing this. If you read through this thread you'll see some of them: viewtopic.php?f=3&t=6983