Can't get my TPIPE /replace to work

Jun 3, 2008
130
3
Temecula, CA
I've got a file called CreateISO.ibb that contains the following (along with a lot more, but for now this is good enough):

IBB

[START_BACKUP_OPTIONS]
BuildInputMode=1
BuildOutputMode=2
Destination=
DataType=0
FileSystem=1

I executed the command (all on one line)

tpipe /input=%TEMP%\CreateISO.ibb /replace=0,0,0,0,0,0,0,0,0,Destination=,Destination=%_DEST% /output=%TEMP%\CreateISO.ibb

I expected that this would take the line that had an empty Destination= string and replace it with Destination= followed by the value of the _DEST environment variable, which I've confirmed is non-empty (_DEST='c:\VESTA Analytics 3.1 (3.1.75.0).iso'). But the file is unchanged. I thought that maybe it was a file in, file out, overwriting kind of issue, so I tried using /output=%TEMP%\CreateISO.ibb.new, but this file was an exact copy of the original.

What am I doing wrong, and how do I fix it?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,469
88
Albuquerque, NM
prospero.unm.edu
Notice that your variable's value contains spaces. I think you'll have to quote it:
Code:
tpipe /input=%TEMP%\CreateISO.ibb /replace=0,0,0,0,0,0,0,0,0,Destination=,Destination="%_DEST" /output=%TEMP%\CreateISO.ibb

But your file looks pretty much like an .INI file to me. It might be simpler to use @INIWRITE.
 
Jun 3, 2008
130
3
Temecula, CA
I agree that it looks like an INI file. Doesn't that first line, with no brackets around it (IBB), disqualify it from using @INIWRITE? Well, I'll be gobsmacked :sorry: it works! I guess I'll go with that!

But as a learning exercise, to the first point, I've modified the code in the batch file prior to the TPIPE call so that _DEST no longer has any single quotes around it, and I used %@quote[%_DEST] instead of hard-coding quotes in your statement above. But it still does nothing.
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
I copied your IBB example text into a file named foo.ibb and set _dest=foo
I ran TPIPE with the output sent to the console:
Code:
tpipe /input=foo.ibb /replace=0,0,0,0,0,0,0,0,0,"Destination=","Destination=%_DEST"
IBB

[START_BACKUP_OPTIONS]
BuildInputMode=1
BuildOutputMode=2
Destination=foo
DataType=0
FileSystem=1

So Destination did get replaced. What does your _DEST environment variable contain?
Also, variables in TCC use a single percent sign - e.g. %_DEST vs %_DEST%
 
Jun 3, 2008
130
3
Temecula, CA
Thanks for your response, Scott.

I copied your IBB example text into a file named foo.ibb and set _dest=foo

...

So Destination did get replaced. What does your _DEST environment variable contain?

_DEST=c:\VESTA Analytics 3.1 (3.1.75.0).iso

Also, variables in TCC use a single percent sign - e.g. %_DEST vs %_DEST%

True. I was taking an original .bat file, making significant changes, and was in the habit of following the convention required for CMD.

At this point, I believe the issue is that the single backslash has to be replaced by two, since it appears that regular expression processing is interfering. I will probably also have to backslash the parends. But given that I have a new thread (and the followup here was really a learning exercise), I think I will abandon this one and continue with that one. Thanks for the help!
 
Similar threads
Thread starter Title Forum Replies Date
x13 TPIPE /REPLACE - Remove line (including EOL) Support 3
vefatica Back-refs in TPIPE's /replace's replacement string? Support 2
vefatica TPIPE /replace? Support 3
samintz How to? TPIPE /simple=61 Support 6
R Bug TPIPE's pdf to text conversions don't work Support 2
Kachupp How to? tpipe Support 4
H TPIPE /simple=4 Support 12
D TPIPE produces unwanted logs. Support 1
Kachupp How to? tpipe Support 8
vefatica Documentation TPIPE, /perl, DotMatchesNewLines Support 1
vefatica Stop TPIPE /EOL removing bad EOLs (and TPIPE changine EOLs)? Support 2
vefatica TPIPE in an alias? Support 2
C How to? TPIPE ?'s Support 2
H History and TPipe Oddness Support 3
Jay Sage Baffling Behavior With TPIPE Support 5
vefatica TPIPE: unbalanced escaped quotes in a regex? Support 5
Joe Caverly Multiple Text Searches at once using FFIND or TPIPE Support 4
Kachupp FFIND TPIPE Support 9
vefatica TPIPE and avarice? Support 5
Peter Murschall TPIPE generate unicode on Piping or redirecting Support 3
Charles Dye Documentation TPIPE /REPLACELIST Support 0
Joe Caverly TPIPE and /inputstring Support 3
vefatica How to? Add real <ESC> characters with TPIPE Support 2
vefatica How to? TPIPE ... see output right away? Support 4
vefatica TPIPE.EXE crashes on Ctrl-C Support 9
O TPIPE: Error -Can´t access textpipeengine.dll Support 24
vefatica Extract fields with TPIPE? Support 10
vefatica TPIPE, crash and question Support 1
MickeyF Another TPIPE question Support 6
Joe Caverly Printing TPIPE documentation Support 3
C WAD tpipe /simple=28 Support 8
vefatica Remove double-quotes with TPIPE Support 4
vefatica TPIPE crashes on Ctrl-C Support 1
C How to? Add date/time to custom tpipe based BTM Support 1
C tpipe /simple=28 error Support 5
C TPipe /dup Support 5
T TPipe: Replacing String with Double Quotes Support 3
C tpipe and extract email addresses Support 1
vefatica How do I do this with TPIPE? Support 1
vefatica TPIPE's /perl option? Support 1
D TPIPE help typo Support 0
vefatica TPIPE access violations are back Support 2
Joe Caverly Word Count using TPIPE Support 10
Dan Glynhampton TPIPE in Build 41 Support 4
Phileosophos TPIPE doesn't work at all with v16 Support 3
vefatica TPIPE access violation again Support 1
David McClelland TPIPE matching problem Support 3
vefatica TPIPE: Access violation Support 5
jbanaszczyk TCMD 16 - TPIPE Support 4
P TPipe relaunches TCC window and 4start, etc Support 7

Similar threads